[ImageJ-devel] Netbeans and Maven

Curtis Rueden ctrueden at wisc.edu
Tue Jan 15 10:01:43 CST 2013


Hi Gerrit,


> 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.
>
> So I have to think about a new approach to deploy my software to my
> users.

I would suggest setting up an update site:
    http://fiji.sc/How_to_set_up_and_populate_an_update_site

>From a developer perspective, this makes your dependency management safer,
because you will not be tempted to bundle potentially incompatible versions
of your dependencies within a single "uber-JAR."

>From a user perspective, your users can add it to their Fiji installation:
    http://fiji.sc/How_to_follow_a_3rd_party_update_site

And they will no longer need to update your JAR file(s) manually. Whenever
you release a new version, Fiji will inform them, and they simply click a
button to update.

Alternately, if you really want to keep supporting ImageJ1 sans Fiji, you
can use the maven-assembly-plugin to create an uber-JAR that bundles all
your dependencies and code into a single JAR. (E.g., for the Bio-Formats
project, we have "loci_tools.jar".) But as mentioned above, you may have
dependency version conflicts if you bundle version A of a dependency, and a
different uber-JAR bundles version B.


>         //context = ?????????

    context = new ImageJ(true); // create an empty context

The "empty" context (i.e., with no services) should suffice for your use
case. Or if you want to lean on any ImageJ2 services, you can do:

    context = new ImageJ(); // create a full-featured context

Or to avoid the ij-core dependency, you can just copy the Manifest parsing
code from ImageJ2's Manifest.getManifest method:


https://github.com/imagej/imagej/blob/7ffe00ef/core/core/src/main/java/imagej/util/Manifest.java#L133

HTH,
Curtis


On Tue, Jan 15, 2013 at 9:31 AM, Polder, Gerrit <gerrit.polder at wur.nl>wrote:

> Johannes,
>
> thanks a lot, I'm getting progress.
>
> On 15 Jan 2013, at 01:12, Johannes Schindelin <Johannes.Schindelin at gmx.de>
> wrote:
>
> >> 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:
> >
> I'm referring to the scijave version number, which is 1.25 in my
> downloaded example project.
> https://github.com/imagej/minimal-ij1-plugin/blob/master/pom.xml#L11
>
> >> 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.
> >
> ok, thanks, this makes it clear.
>
> >> 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.
> For Fiji the generated jars are copied to /Application/Fiji.app/jars which
> is ok.
> For ImageJ thay are copied to /Application/ImageJ/jars, but that folder is
> not used by the ImageJ application.
> There the ij.jar is buried somewhere in the package contents.
> In my previous ant build.xml I pointed to this files in order to run and
> debug  IJ from netbeans.
>
> 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.
> The plugin is also started from the startup macros.txt and the imagej menu
> is hidden.
>
> So I have to think about a new approach to deploy my software to my users.
>
> >
> >> 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.
> But for some unknown reason it works now, maybe the 'imagej.app.directory'
> setting?
> don't bother!
>
> >
> >> 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?
>
> >
> >> 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();
>
> thanks for your help,
> Gerrit.
>
>
>
>
>
>
>
> _______________________________________________
> ImageJ-devel mailing list
> ImageJ-devel at imagej.net
> http://imagej.net/mailman/listinfo/imagej-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130115/328447b9/attachment.html>


More information about the ImageJ-devel mailing list