[ImageJ-devel] Netbeans and Maven

Johannes Schindelin Johannes.Schindelin at gmx.de
Mon Jan 14 18:12:18 CST 2013


Hi Gerrit,

On Mon, 14 Jan 2013, Polder, Gerrit wrote:

> I am using netbeans with ant as the building system quite some time now
> (on Mac OS X).  During the last developer conference there was a strong
> emphasis on maven as build/dependency tool, so I decided to give it a
> try.  I started with the process_pixels example which compiles and runs
> nice, but I have some questions.  Sorry if these are dumb questions, but
> I scanned through the documentation and didn't find answers quickly.

The ImageJ and ImageJ-devel lists are pleasant lists, no need to apologize
for asking questions that were not answered well enough at the conference.

> 1- what does the pom version mean, and which version should I use, I
> found different numbers in the examples.

If I understand correctly, you are referring to the version number here:

https://github.com/imagej/minimal-ij1-plugin/blob/master/pom.xml#L16

The idea of Maven is that every project comes in a specific version. For
example, you might want to release your plugin as version 0.1.0 or 1.0.0.
Leading up to that version, you would probably label it as 0.1.0-SNAPSHOT
or 1.0.0-SNAPSHOT to indicate that this is an intermediate revision
leading up to said version.

So it is your choice what version number to use ;-)

> 2- how is the imagej version determined
> (<version>${imagej1.version}</version>) ?

It is defined in the SciJava POM, as a version range:

https://github.com/scijava/scijava-common/blob/master/pom-scijava/pom.xml#L21

Basically, it says: every version from 1.45s on is good enough for us.

If it is actually not good enough for your project, e.g. because you
require a feature Wayne introduced in, say, 1.47b, you need to override
that setting in your pom.xml in the properties section:

	<properties>
		<imagej1.version>1.47b</imagej1.version>
	</properties>

You could also decide that a version range [1.47b,) is preferable, of
course.

> 3- During build I see the following message: Property
> 'imagej.app.directory' unset; Skipping copy-jars
> So it must be possible to place the jar into my own imagej installation,
> how?

You can set the property either in the <properties> section of your
pom.xml as described for imagej1.version above, or via the command-line.
Probably Netbeans lets you define that, too, but since I am not using
Netbeans myself, I cannot tell you how, sorry!

> 4- During run an imagej jar from ~/.m2.... is started, is this only for
> test/debug? how to use my own imagej?

This is only used to compile your .jar file. If you set the
imagej.app.directory property properly, it will actually be copied into
the jars/ subdirectory of the location you pointed the property to.

> 5- The process_pixels application does not quit properly, I have to stop
> it from netbeans.

Sorry, do you have more information about that? I do not understand the
issue.

> 6- My software is dependent from other plugins, such as particle8 from
> Gabriel Landini's Morphology, can/is this incorporated in the imagej
> maven repository?

The easiest way to do that would probably to install it locally for the
moment. Please see Maven's console log for details how to do that after
specifying a dependency, e.g.

		<dependency>
			<groupId>uk.ac.bham.dentistry</groupId>
			<artifactId>Particles8_</artifactId>
			<version>1.6</version>
		</dependency>

(I took the version number from the web site, and constructed the groupId
from the web site, too. Note that you will need to wrap the .class files
in a .jar file before installing it locally.)

> 7- In my ant script I'm using a call to svnversion, in order to place
> the latest build number and date in the about box. Can this be done in
> maven?

The way this is done in Maven is by using the buildnumber plugin. This
will put the current revision into the MANIFEST.MF under the tag
'Implementation-Build'.

You probably want to depend on ij-core (groupId net.imagej, version
2.0.0-SNAPSHOT for now) to retrieve that:

http://jenkins.imagej.net/job/ImageJ-daily/javadoc/imagej/util/Manifest.html#getManifest(java.lang.Class)

and

http://jenkins.imagej.net/job/ImageJ-daily/javadoc/imagej/util/Manifest.html#getImplementationBuild()

Ciao,
Johannes



More information about the ImageJ-devel mailing list