Wiki source code of Maven Creating Wonder Applications
Version 42.1 by Greg.Brown on 2009/02/18 14:56
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
17.1 | 1 | = Creating Wonder Applications using Maven + m2eclicpse = |
2 | |||
3 | {{note}} | ||
![]() |
21.1 | 4 | Under Construction |
![]() |
17.1 | 5 | {{/note}} |
6 | |||
7 | If you want to use Wonder in your applications (and why woundn't one) you must be correctly setup with: | ||
8 | |||
9 | * eclipse + wolips > see tutorial about installation and operation. | ||
10 | * Maven > see the Maven [[Quick Start]] tutorial. | ||
11 | * plugins like [[m2eclipse>>http://m2eclipse.codehaus.org/]] which supports Maven-eclipse integration. | ||
12 | * Wonder sources which then are built and installed in your local repository. | ||
13 | |||
14 | One reasonable way to get and maintain the Wonder sources is have a directory which holds all the sources (see here: [[Download Wonder Source>>http://wiki.objectstyle.org/confluence/display/WONDER/Download+Wonder+Source%2C+Build+and+Install]]), then use Maven to install and build Wonder (see here: [[Building the wonder source code with maven]]). | ||
15 | |||
![]() |
37.1 | 16 | Several things you should know: |
![]() |
17.1 | 17 | |
18 | * Wonder is built using a maven "build profile", e.g. "mvn clean install --P wo53" builds things for a WebObjects 5.3.x environment and "mvn clean install --P wo54" builds things for a WebObjects 5.4.x environment. | ||
19 | * The only frameworks which are different because of this are ERExtensions and WOOgnl. | ||
20 | * Because of this difference you must specify which version you want. For instance, you may want the ERExtensions-5.0.0-SNAPSHOT-wo53.jar, or the ERExtensions-5.0.0-SNAPSHOT-wo54.jar. You specify by adding a "classifier", which would have the value of wo53 or wo54. The other frameworks should not have this classifier. | ||
21 | |||
22 | With all the tools ready, it's time to make a Wonder application. | ||
23 | |||
![]() |
33.1 | 24 | 1. Make a new project File > New > Other project, choose a Maven project: |
![]() |
29.1 | 25 | 1. Hit Next |
![]() |
31.1 | 26 | 1. Select an archtype, use the local catalog, select the woapplication-archtype, hit Next: |
![]() |
29.1 | 27 | 1. Fill in appropriate parameters for the woapplication-archtype to set up your new application, hit Finish! |
![]() |
17.1 | 28 | |
29 | The eclipse plugins now create your application! | ||
30 | |||
![]() |
41.1 | 31 | You should create a WOApplication Run Configuration and add the projects build folder's Java to the classpath as detailed here: [[Maven Running or Debugging as WO Application]], otherwise classes won't be found, etc. |
![]() |
17.1 | 32 | |
33 | {{note title="Warning"}} | ||
34 | The woapplication-archtype is under construction, so you must fix a few things. | ||
35 | # Fix the pom.xml. Delete the properties and dependencies sections that the woapplication-archtype created, and paste this into the pom: | ||
36 | {code:xml} | ||
![]() |
25.1 | 37 | |
![]() |
17.1 | 38 | <properties> |
![]() |
27.1 | 39 | <woversion>5.3.3</woversion> |
![]() |
17.1 | 40 | <wonderversion>5.0.0-SNAPSHOT</wonderversion> |
41 | </properties> | ||
42 | |||
43 | <dependencyManagement> | ||
44 | <dependencies> | ||
45 | <dependency> | ||
![]() |
27.1 | 46 | <groupId>com.webobjects</groupId> |
47 | <artifactId>JavaFoundation</artifactId> | ||
48 | <version>${woversion}</version> | ||
![]() |
17.1 | 49 | </dependency> |
50 | <dependency> | ||
51 | <groupId>com.webobjects</groupId> | ||
52 | <artifactId>JavaWebObjects</artifactId> | ||
53 | <version>${woversion}</version> | ||
54 | </dependency> | ||
55 | <dependency> | ||
56 | <groupId>com.webobjects</groupId> | ||
57 | <artifactId>JavaEOAccess</artifactId> | ||
58 | <version>${woversion}</version> | ||
59 | </dependency> | ||
![]() |
27.1 | 60 | <dependency> |
61 | <groupId>wonder.core</groupId> | ||
62 | <artifactId>ERExtensions</artifactId> | ||
63 | <version>${wonderversion}</version> | ||
64 | <classifier>wo53</classifier> | ||
65 | </dependency> | ||
![]() |
17.1 | 66 | <dependency> |
![]() |
27.1 | 67 | <groupId>wonder.core</groupId> |
68 | <artifactId>ERPrototypes</artifactId> | ||
69 | <version>${wonderversion}</version> | ||
70 | |||
![]() |
17.1 | 71 | </dependency> |
72 | </dependencies> | ||
73 | </dependencyManagement> | ||
![]() |
27.1 | 74 | <!-- Only ERExtensions and WOOgnl need a wo53 or wo54 classifier --> |
![]() |
17.1 | 75 | <dependencies> |
76 | <dependency> | ||
77 | <groupId>wonder.core</groupId> | ||
78 | <artifactId>ERExtensions</artifactId> | ||
![]() |
27.1 | 79 | <version>${wonderversion}</version> |
80 | <classifier>wo53</classifier> | ||
![]() |
17.1 | 81 | </dependency> |
82 | <dependency> | ||
83 | <groupId>wonder.core</groupId> | ||
84 | <artifactId>ERPrototypes</artifactId> | ||
![]() |
27.1 | 85 | <version>${wonderversion}</version> |
![]() |
17.1 | 86 | </dependency> |
87 | <dependency> | ||
88 | <groupId>com.webobjects</groupId> | ||
89 | <artifactId>JavaFoundation</artifactId> | ||
![]() |
27.1 | 90 | <version>${woversion}</version> |
![]() |
17.1 | 91 | </dependency> |
92 | <dependency> | ||
93 | <groupId>com.webobjects</groupId> | ||
94 | <artifactId>JavaWebObjects</artifactId> | ||
![]() |
27.1 | 95 | <version>${woversion}</version> |
![]() |
17.1 | 96 | </dependency> |
97 | <dependency> | ||
98 | <groupId>com.webobjects</groupId> | ||
99 | <artifactId>JavaEOAccess</artifactId> | ||
![]() |
27.1 | 100 | <version>${woversion}</version> |
![]() |
17.1 | 101 | </dependency> |
![]() |
27.1 | 102 | |
![]() |
17.1 | 103 | </dependencies> |
104 | |||
![]() |
39.1 | 105 | {code} Fix the versions and classifiers in the pom to be the correct values. |
![]() |
17.1 | 106 | |
![]() |
41.1 | 107 | 2. Fix the Application, Session, DirectAction jave files. They all should: {code}import er.extensions.appserver.ERX????{code} But the ".appserver." is left out of the import statements. |
![]() |
17.1 | 108 | |
109 | {{/note}} |