Creating Wonder Applications using Maven + m2eclicpse
Under Construction
If you want to use Wonder in your applications (and why woundn't one) you must be correctly setup with:
- eclipse + wolips > see tutorial about installation and operation.
- Maven > see the Maven Quick Start tutorial.
- plugins like m2eclipse which supports Maven-eclipse integration.
- Wonder sources which then are built and installed in your local repository.
One reasonable way to get and maintain the Wonder sources is have a directory which holds all the sources (see here: Download Wonder Source), then use Maven to install and build Wonder (see here: Building the wonder source code with maven).
Several things you should know, currently:
- 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.
- The only frameworks which are different because of this are ERExtensions and WOOgnl.
- 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.
With all the tools ready, it's time to make a Wonder application.
- Make a new project File > New > Other project, choose a Maven project:
- Hit Next
- Select an archtype, use the local catalog, select the woapplication-archtype, hit Next:
- Fill in appropriate parameters for the woapplication-archtype to set up your new application, hit Finish!
The eclipse plugins now create your application!
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.
Warning
The woapplication-archtype is under construction, so you must fix a few things.
- Fix the pom.xml. Delete the properties and dependencies sections that the woapplication-archtype created, and paste this into the pom:
Fix the versions and classifiers in the pom to be the correct values.
<properties> <woversion>5.3.3</woversion> <wonderversion>5.0.0-SNAPSHOT</wonderversion> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaFoundation</artifactId> <version>${woversion}</version> </dependency> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaWebObjects</artifactId> <version>${woversion}</version> </dependency> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaEOAccess</artifactId> <version>${woversion}</version> </dependency> <dependency> <groupId>wonder.core</groupId> <artifactId>ERExtensions</artifactId> <version>${wonderversion}</version> <classifier>wo53</classifier> </dependency> <dependency> <groupId>wonder.core</groupId> <artifactId>ERPrototypes</artifactId> <version>${wonderversion}</version> </dependency> </dependencies> </dependencyManagement> <!-- Only ERExtensions and WOOgnl need a wo53 or wo54 classifier --> <dependencies> <dependency> <groupId>wonder.core</groupId> <artifactId>ERExtensions</artifactId> <version>${wonderversion}</version> <classifier>wo53</classifier> </dependency> <dependency> <groupId>wonder.core</groupId> <artifactId>ERPrototypes</artifactId> <version>${wonderversion}</version> </dependency> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaFoundation</artifactId> <version>${woversion}</version> </dependency> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaWebObjects</artifactId> <version>${woversion}</version> </dependency> <dependency> <groupId>com.webobjects</groupId> <artifactId>JavaEOAccess</artifactId> <version>${woversion}</version> </dependency> </dependencies>
2. Fix the Application, Session, DirectAction jave files. They all should:
import er.extensions.appserver.ERX????
But the ".appserver." is left out of the import statements.
3. Possibly change web components to extend er.extensions.components.ERXComponent instead of the standard WOComponent.
4. Possible classpath issues; the eclipse component editor has multiple Component and Display Group tabs.?
5. Main component is NSMacOSRomanStringEncoding, non-Maven Wonder apps use "UTF-8" in the woo.