Maven Build
From OpenLaszlo
| Project owner | Warner Onstine |
|---|---|
| Contributors | Oliver Steele |
Contents |
Overview
Within the server directory, the source files are in src and jgenerator-2.2, except for some jython and javacc files in sc, which are compiled into java files in build/src. Also, a few of the source files are named *.java.proto instead of *.java. The ant build file preprocesses these into *.java files also in build/src.
The current maven build file doesn't build the javacc and jython-generated files and it doesn't preprocess the *.java.proto files. It assumes that the ant 'build' target (in WEB-INF/lps/server/build.xml) has already been run, which clearly isn't the right way to use maven.
Some of the issues with the current maven build file are:
- Some of the files are in WEB-INF/lps/server/sc/src. These need to be compiled together with the sources in WEB-INF/lps/server/src.
- The files that jython generates (at least) need to compile with -source=1.3
- Some other packages (javax.xml.rpc, org.apache.axis.*) can't be found --- this may just be matter of the dependency jars being out of date
Take a look at the 3.0b1 source distribution, available from the web site. I think i've added maven files for jgenerator and LPS to that the sources, but I haven't checked yet to see that they got into the source distribution. (If they didn't, I'll mail them to you.) But in any case, these do away with the *.java.proto files, which should eliminate one problem.
Issues
Multiple Sources
Some of the Java sources are in WEB-INF/lps/server/src, and others are in WEB-INF/lps/server/sc/src. You could move the server/sc/src files into server/src to make it easier to write the maven file. I meant to do this before the 3.0b1 release, but didn't get to it. Since we can fix the directory structure here, I wouldn't spend fixing this in the maven files unless it's easy to do so.
JythonC
The next task is to tell Maven to use Jythonc to build the script compiler files. These files are the *.py files in server/sc, and there's an ant task (sc-compiler, in server/build.xml) that compiles these to Java files which are placed in server/build/src. If there's already a maven plugin that compiles Jython files, then you could use it (but point it at our copy of the Jython compiler, at ${LPS_HOME}/3rd-party/tools/jythonc/jythonc.py, instead of using the standard one). If there isn't such a maven plugin, then this would be something that is independently useful to the open source community, since there's a lot of interest in Jython independently of OpenLaszlo.
The ant build target for building the jython files does the equivalent of this:
cd sc
jython ${LPS_HOME}/3rd-party/tools/jythonc/jythonc.py \
--package org.openlaszlo.sc \
--workdir ../${build.java} \
--deep \
--compiler NONE \
Compiler parseinstructions LFCCompiler Regenerator
JavaCC
TBD
Dependencies
There are probably some jar dependencies that I missed; I was getting unknown class errors even when I tried to do some of this by hand. These may be easier to diagnose after jythonc and javacc are integrated into the build.

