Quick Start

Last modified by Paul Hoadley on 2025/01/30 02:09

You should be able to get a "Hello, World!" Wonder application running using Maven in about 10 minutes.

Assumptions

We're going to make a few assumptions to keep this page brief:

  1. You are running macOS X. You can probably get a WebObjects development environment up on a different OS, but we won't cover that here.
  2. You have Java installed. Any version will do. People are running WebObjects on Java 21 in production.
  3. You have Eclipse and WOLips installed. Install the latest version of Eclipse, along with the latest WOLips if you haven't already.

Setup

You need to install Maven:

$ cd ~/Applications
$ curl -O https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.zip
$ unzip apache-maven-3.9.9-bin.zip
$ ln -s apache-maven-3.9.9 apache-maven

Add bin to your path in your shell's startup file, say ~/.zshrc:

PATH=$PATH:/Users/paulh/Applications/apache-maven-3.9.9/bin

Confirm you have it installed:

$ mvn --version                
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)

Finally, add ~/.m2/settings.xml:

<settings xmlns="http://maven.apache.org/POM/4.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
          http://maven.apache.org/xsd/settings-1.0.0.xsd">
  <profiles>
    <profile>
      <id>wocommunity</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>wocommunity</id>
          <url>https://maven.wocommunity.org/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>wocommunity</id>
          <url>https://maven.wocommunity.org/content/groups/public/</url>
          <releases>
            <enabled>true</enabled>
          </releases>
          <snapshots>
            <enabled>false</enabled>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
</settings>

Create a new application project

Make a new directory somewhere, and run:

$ mvn archetype:generate -DarchetypeArtifactId=erxapplication-archetype \
        -DarchetypeGroupId=org.wocommunity \
        -DarchetypeVersion=3.0 -DaskForDefaultPropertyValues=true

After some downloading, Maven will prompt you:

Define value for property 'JavaVersion' 1.8: : 1.8
Define value for property 'WonderVersion' 7.2: : 7.4
Define value for property 'groupId': example.app   
Define value for property 'artifactId': Foo
Define value for property 'version' 1.0-SNAPSHOT: : 0.1-SNAPSHOT
Define value for property 'package' example.app: : example.app.foo

You can enter any version of Java. You should definitely change WonderVersion from 7.2 → 7.4. Hit 'Y' to confirm when requested.

If you enter a JavaVersion greater than 1.8 (there are people using Java 21 in production, for example: enter 21), you need to add the following line to build.properties:

jvmOptions=--add-exports java.base/sun.security.action=ALL-UNNAMED --add-exports java.base/sun.util.calendar=ALL-UNNAMED

Build and launch the application

From the same directory, run:

$ cd Foo 
$ mvn package

Once Maven has finished building, you can launch:

$ ./target/Foo.woa/Foo

A browser should open and show:

Hello WOnder world!

Import your project into Eclipse

A final, optional step is to bring the project into Eclipse.

  1. File > Import... > Maven > Existing Maven Projects
  2. Using the file browser, find the top-level "Foo" folder containing the project you created above, click Open.
  3. Ensure pom.xml is checked and click Finish.

As above, if you're using Java beyond Java 8, you need to add the following to the launch configuration under Arguments > VM arguments:

--add-exports java.base/sun.security.action=ALL-UNNAMED --add-exports java.base/sun.util.calendar=ALL-UNNAMED

You're done.