[ImageJ-devel] Maven-based build system for LOCI software

Curtis Rueden ctrueden at wisc.edu
Fri Aug 6 18:50:47 CDT 2010


Hello OMERO, ImageJ2 and Fiji developers,

I wanted to let you know that I just committed an experimental branch to
LOCI's SVN that reorganizes the components as Maven projects. At the moment
the following components have been migrated:

  * projects/bio-formats
  * projects/loci-common
  * projects/loci-plugins
  * projects/ome-xml
  * forks/jai
  * forks/mdbtools
  * forks/poi
  * stubs/lwf-stubs

I will be migrating the remaining components, as well as doing the same for
ImageJ and imglib in our Git repositories, next week. If there are no major
obstacles or objections, I will also merge the branches to trunk/master
within the next 2-6 weeks, and announce to relevant lists. These changes
should make it easier for Fiji to adopt ImageJ2 as it develops without
worrying about transitive dependency problems.

As part of this effort, I set up a Nexus repository at
http://loci.wisc.edu:8081/, which you are welcome to try out. In related
news, as some of you already know, we also set up our own Hudson at
http://loci.wisc.edu:8080/. (But note that these URLs may change again to "
dev.loci.wisc.edu" once our new developer server arrives.)

One major advantage of Maven is that you can check out only the project you
want to build, rather than the entire LOCI Software repository. For example,
you can:

$ svn co http://loci.wisc.edu/svn/java/branches/maven/projects/bio-formats
$ cd bio-formats
$ mvn jar:jar

To build bio-formats.jar.

You don't need the source for the dependent projects because it will fetch
all the dependencies as binaries from our Nexus server and store them in
your local Maven repository (in ~/.m2/repository).

You can also generate an Eclipse project with:

$ mvn eclipse:eclipse

You just have to define a classpath variable called M2_REPO pointing at
~/.m2/repository and you're ready to go (or you can the
eclipse:configure-workspace target to do it... or you can use the m2eclipse
Eclipse plugins).

Alternately, you can check out the entire source tree as before, and create
Eclipse projects with project dependencies rather than JAR dependencies:

$ svn co http://loci.wisc.edu/svn/java/branches/maven
$ cd maven
$ mvn eclipse:eclipse

This will compile and build the source for all Mavenized projects—it works
because there is an aggregate project in the base directory declaring the
involved submodules.

I haven't tested it yet but Maven supposedly works well with NetBeans and
IDEA also.

In the conversion to Maven, I was amazed how much metadata I had
independently identified and declared in either custom Ant build.properties
files, or in my hacky scan-deps.pl dependency analysis script in the base
directory. With Maven It should be very doable to migrate away from those
custom solutions now. E.g., you can analyze the dependencies for correctness
with:

$ mvn dependency:analyze

In conclusion, I am unilaterally very impressed with Maven so far. And from
what I've read, it believe it will play nicely with OMERO's usage of Ivy.

For those with time and interest, feel free to check it out. Any feedback is
welcome!

-Curtis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20100806/0d2766e2/attachment.html>


More information about the ImageJ-devel mailing list