Version 30.1 by Greg.Brown on 2009/02/19 11:01

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