Putting the WebObjects Libraries in to a Maven Repository

A Maven repository is simply a collection of .jars that Maven can access when it builds your projects. This can be a web server, file server, a server running special 'repository software', or simply the local Maven repository (~/.m2/repository). Irrespective of what type of repository you set up, you will need to put a copy of the WebObjects libraries in to your repository.

This is a straight-foward task, and although it may take a few minutes, it is something you only have to do once (per WebObjects release).

Whilst you're probably familiar with the various 'frameworks' that are installed on your computer when you install WebObjects, what you might not realise is that (almost) all the WebObjects libraries you need to build and deploy your application are also installed as 'plain java' .jars in /Library/WebObjects/lib.

So, before you start using Maven to build your WebObjects applications, you need to copy these .jars in to your Maven repository. Maven assumes that .jars will be named and located according to a specific convention, and also requires some additional meta-data about each .jar. The easiest way to load .jars in to your local Maven repository in the correct format is to use the install-file goal of the Maven install plugin.

To load all of the WebObjects libraries in to your local Maven repository execute the following command for each .jar in /Library/WebObjects/lib:

mvn install:install-file -Dfile=/Library/WebObjects/lib/JavaEOAccess.jar \
    -DgroupId=webobjects.apple \
    -DartifactId=java-eo-access \
    -Dversion=5.3.3 -Dpackaging=jar \
    -DgeneratePom=true

Finally, as I mentioned before almost all the Java libraries you need can be found in /Library/WebObjects/lib. The one notable exception is the library containing the WOServletAdaptor which you need if you want to build your application as a .WAR. This library can be found in /System/Library/Frameworks/JavaWOJSPServlet.framework /WebServerResources/Java/JavaWOJSPServlet_client.jar. Install it in your local Maven repository by executing (with the full path):

mvn install:install-file \
    -Dfile=.../WebServerResources/Java/JavaWOJSPServlet_client.jar \
    -DgroupId=webobjects.apple \
    -DartifactId=java-jsp-servlet-client \
    -Dversion=5.3.3 \
    -Dpackaging=jar \
    -DgeneratePom=true

Alternatively, assuming you have WebObjects 5.3.3 installed in the standard place on Mac OS X, run this 'load-wo-jars.sh' shell script which consists of a bunch of 'mvn install:install-file' commands.

If you have WebObjects 5.4 installed in the standard place on Mac OS X, run this 'load-wo54-jars.sh' shell script.

SourceForge.net Logo