[ImageJ-devel] Finding classes and importing the right Maven artifacts

Johannes Schindelin Johannes.Schindelin at gmx.de
Thu Jul 26 12:00:15 CDT 2012


Hi Michael,

On Thu, 26 Jul 2012, Michael Doube wrote:

> >> Mostly, Eclipse has handled that OK. But, now I'm editing my pom.xml
> >> and am missing a couple of dependencies, which are really hard to
> >> find.
> 
> OK, so I found them by trial and error by searching at
> http://maven.imagej.net:8081/index.html#welcome and editing pom.xml
> until build errors went away.

Yes, we need to make that much, much easier. I will write a plugin
intended for developers you can use to add dependencies given a class name
(under the condition that the class name is in Fiji's class path and that
the corresponding .jar file has a valid pom.xml in it) and a pom.xml you
want to extend.

> What was tripping me up was that there are several versions of
> ij-platform, for example. The beta releases (fixed states, right?) and
> the SNAPSHOTS (updating often, right?). So far, so good. But, then there
> are versions 2.0-SNAPSHOT and 2.0.0-SNAPSHOT. And one with a sources
> classifier. And there is also an ij-platform artifact with the group ID
> imagej, version 2.0-SNAPSHOT, and several others with group ID
> net.imagej. So, even guessing the right artifact name could point at
> eight distinct actual artifacts.

In general, until the API of ImageJ2 stabilizes, you should always use
2.0.0-SNAPSHOT. To be safe, you could just make the scijava .pom your
parent pom (as it is e.g. here:
https://github.com/fiji/fiji/blob/master/src-plugins/pom.xml; it requires
the <parent> and <repositories> tags to be set correctly) and use
${imagej.version} instead (see
https://github.com/scijava/scijava-common/blob/master/pom-scijava/pom.xml
for the available properties).

> Even more confusing is this recommendation for pom.xml at
> http://fiji.sc/wiki/index.php/Maven
> 
> 		<dependency>
> 			<groupId>net.imagej</groupId>
> 			<artifactId>ij</artifactId>
> 			<version>1.46j</version>
> 		</dependency>
> 		<dependency>
> 			<groupId>imagej</groupId>
> 			<artifactId>imagej</artifactId>
> 			<version>2.0-SNAPSHOT</version>
> 		</dependency>
> 
> Which makes it look like ImageJ1 is under net.imagej and ImageJ2 is
> under imagej.

You should specify exactly which component you require of ImageJ2, e.g.
ij-data or ij-core. They are in net.imagej and they all have the version
2.0.0-SNAPSHOT at the moment.

Ciao,
Dscho



More information about the ImageJ-devel mailing list