Version 27.1 by Greg.Brown on 2009/02/20 07:26

Show last authors
1 = Creating Wonder Applications using Maven + m2eclicpse =
2
3 {{note}}
4 Under Construction
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
16 Several things you should know, currently:
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
24 ~1. Make a new project File > New > Other project, choose a Maven project: [[image:wolimmave2.gif]]
25
26 2. Hit Next
27
28 3. Hit Next again [[image:wolimmavena.gif]]
29
30 4. Select an archtype, use the local catalog, select the woapplication-archtype, hit Next:!wolimmavenb.gif!
31
32 5. Fill in appropriate parameters for the woapplication-archtype to set up your new application, hit Finish!
33
34 [[image:wolimmaven.gif]]
35
36 The eclipse plugins now create your application!
37
38 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.
39
40 {{note title="Warning"}}
41 The woapplication-archtype is under construction, so you must fix a few things.
42 # Fix the pom.xml. Delete the properties and dependencies sections that the woapplication-archtype created, and paste this into the pom:
43 {code:xml}
44
45 <properties>
46 <woversion>5.3.3</woversion>
47 <wonderversion>5.0.0-SNAPSHOT</wonderversion>
48 </properties>
49
50 <dependencyManagement>
51 <dependencies>
52 <dependency>
53 <groupId>com.webobjects</groupId>
54 <artifactId>JavaFoundation</artifactId>
55 <version>${woversion}</version>
56 </dependency>
57 <dependency>
58 <groupId>com.webobjects</groupId>
59 <artifactId>JavaWebObjects</artifactId>
60 <version>${woversion}</version>
61 </dependency>
62 <dependency>
63 <groupId>com.webobjects</groupId>
64 <artifactId>JavaEOAccess</artifactId>
65 <version>${woversion}</version>
66 </dependency>
67 <dependency>
68 <groupId>wonder.core</groupId>
69 <artifactId>ERExtensions</artifactId>
70 <version>${wonderversion}</version>
71 <classifier>wo53</classifier>
72 </dependency>
73 <dependency>
74 <groupId>wonder.core</groupId>
75 <artifactId>ERPrototypes</artifactId>
76 <version>${wonderversion}</version>
77
78 </dependency>
79 </dependencies>
80 </dependencyManagement>
81 <!-- Only ERExtensions and WOOgnl need a wo53 or wo54 classifier -->
82 <dependencies>
83 <dependency>
84 <groupId>wonder.core</groupId>
85 <artifactId>ERExtensions</artifactId>
86 <version>${wonderversion}</version>
87 <classifier>wo53</classifier>
88 </dependency>
89 <dependency>
90 <groupId>wonder.core</groupId>
91 <artifactId>ERPrototypes</artifactId>
92 <version>${wonderversion}</version>
93 </dependency>
94 <dependency>
95 <groupId>com.webobjects</groupId>
96 <artifactId>JavaFoundation</artifactId>
97 <version>${woversion}</version>
98 </dependency>
99 <dependency>
100 <groupId>com.webobjects</groupId>
101 <artifactId>JavaWebObjects</artifactId>
102 <version>${woversion}</version>
103 </dependency>
104 <dependency>
105 <groupId>com.webobjects</groupId>
106 <artifactId>JavaEOAccess</artifactId>
107 <version>${woversion}</version>
108 </dependency>
109
110 </dependencies>
111
112 {code} Fix the versions and classifiers in the pom to be the correct values.
113
114 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.
115
116 3. Possibly change web components to extend er.extensions.components.ERXComponent instead of the standard WOComponent.
117 4. Possible classpath issues; the eclipse component editor has multiple Component and Display Group tabs.?
118 5. Main component is NSMacOSRomanStringEncoding, non-Maven Wonder apps use "UTF-8" in the woo.
119
120 {{/note}}