Summary
Apple has released nightly builds of current and future updates to WebObjects in the form of a Maven repository that can be downloaded through the Apple Developer Connection website. In conjunction with the Maven repository, Apple has contributed a plugin to WOLips in order to make it easier to access the nightly build and Maven features.
Getting Started
- Download the latest nightly build from Apple Developer Connection
- If someone else is hosting the WebObjects Maven repository skip the following. Install the archive from ADC.
- For a local user only copy, install the 'com' folder in ~/.m2/repository
- To host the repository through a webserver, put the com folder in your webserver doc root. For instance, on Mac OSX put it in /Library/WebServer/Documents/WebObjects.
- Update to the latest WOLips with the Apple Maven Support plugin
Creating a new project
- Go to the menu File -
> New Projects... --> WOLips -> WebObjects Maven Application
- Go through the standard Wizard panels to configure the project
- On the Maven Artifact configuration page, configure the meta information for your project. The most significant popup is to configure the version of the WebObjects runtime you'd like to link against.
- Finish the Wizard panels
Project Layout
The Maven project and file system layout is not like the standard WOLips (Fluffy Bunny) layout. Why? It follows the Maven convention (behavior enforced through file system layout) versus configuration. It'll require a lot less customization of the Maven project file (pom.xml) and other plugin extensions by following the convention. That is not to say that a standard WOLips project layout cannot be configured to work, it'll just take a lot more configuration and redirection of directories and output.
Configuring a project for a remote repository
Maven will initially look for plugins and dependencies in your local repository. Typically this resides in the ~/.m2/repository directory. If a dependency is not found locally, Maven will iterate through your configured remote repositories. These remote repositories can either be configured by text editing the profiles.xml file or through the Apple Maven plugin. The Apple Maven WOLips plugin tries to expose the relevant attributes but does not expose everything in the profiles.xml.
- Open the project Properites through the context menu
- Configure the following URL to the webserver where the remote repository is hosted.
Adding new Dependencies to a Maven project
There is an incredible amount of libraries hosted through the main Apache Maven repository. It's very likely you will want to extend your project to link against them. The Maven Eclipse plugin has a Wizard that allows you to browse the current repository.
To add a dependency:
- Select your project and open the context menu (ctrl-click)
- Select the 'Add Dependency' menu item
- Browse the repository for the desired libraries. For instance if you wanted the latest MySQL jdbc driver:
I got a requirement generated by the (optional) "Maven integration for Mylyn" plugin, so I checked it "off" and had "7 of 14" selected in the second screenshot. Seems to have done no harm, so far ... Gavin