Quick Start

Version 78.1 by Paul Hoadley on 2023/12/25 10:19

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. We are actually going to assume you're using Java 8, but only because it's just marginally easier to launch the application under Java 8. People are running WebObjects on Java 21 in production.
  3. You have Eclipse and WOLips installed. Eclipse versions as recent as 2023-09 have been shown to be just fine, albeit with a slightly modified WOLips. Again we won't cover any of that here.

Setup

You need to install Maven:

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

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

PATH=$PATH:/Users/paulh/Applications/apache-maven-3.9.6/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 your own values if you like, but remember to stick with Java 1.8 for the moment. Hit 'Y' to confirm when requested.

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.

You're done.