[ImageJ-devel] Netbeans and Maven

Johannes Schindelin Johannes.Schindelin at gmx.de
Tue Jan 15 16:49:03 CST 2013


Hi Gerrit,

following Curtis' mail, we decided it'd be a good idea to add a Wiki page
about this:

	http://fiji.sc/Maven_-_Frequently_Asked_Questions

On Tue, 15 Jan 2013, Polder, Gerrit wrote:

> On 15 Jan 2013, at 01:12, Johannes Schindelin <Johannes.Schindelin at gmx.de> wrote:
> 
> >> 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!
> > 
> I added it to the pom file and it works ok, that is to say, for Fiji.
> I have both Fiji and ImageJ installed.

The only purpose of Fiji is to make it easier to work on and with ImageJ.

> My users does not have Fiji, they need a very simple approach, so they
> have standard ImageJ installed and the only thing they need to do is to
> copy the jar file I send them to the plugins folder.

This is only true if you bundle things such as Particles8_.class. In
general, this is not a good idea. We have plenty of evidence on the
fiji-devel and imagej mailing lists that bundling 3rd-party classes in
your .jar will lead to problems -- most likely on the users' side, which
makes things doubly bad.

As Curtis suggested, you probably should make an update site.

If you do not want to provide an update site (for which you should
definitely use Fiji, to avoid doing exactly the same thing as the Fiji
updater again, unless, that is, you want to spend time reinventing the
wheel ;-)), you can always use the Fiji Package Maker:

	http://fiji.sc/Make_Fiji_Package

I seriously do not know how to make things more convenient than that, but
if you do, I would be very thankful for your insights.

> >> 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.
> 
> after quitting the application from the file menu or command-Q it froze
> and I had to force quit it from netbeans.

Most likely you debugged things and the debugger was still at a break
point. In such a case, Java cannot handle any input (since the event
thread is also stopped) and you would experience such a symptom.

> But for some unknown reason it works now, maybe the
> 'imagej.app.directory' setting?

Highly unlikely.

> >> 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.)
> 
> will have a look at this, does Gabriel have no plans to include
> Morphology and his other stuff in Fiji?

I am sure that Gabriel would appreciate help Mavenizing the incredibly
large plugin collection of his!

> >> 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()
> > 
> 
> can you send me an example, how can I get the context of the jar file? , I have the following
> 
> import imagej.util.Manifest;
> …………..
>         //context = ?????????
>         Manifest mf = context.getManifest();
>         String vn = mf.getImplementationBuild();

I provided my example here, for better visibility to the public at large:

http://fiji.sc/Maven_-_Frequently_Asked_Questions#In_my_ant_script_I.27m_using_a_call_to_svnversion.2C_in_order_to_place_the_latest_build_number_and_date_in_the_about_box._Can_this_be_done_with_Maven.3F

Ciao,
Johannes


More information about the ImageJ-devel mailing list