<div dir="ltr">Hi Gerrit,<div><br></div><div style>I was mostly done (except for "..." sections) with a reply to you yesterday, before needing to leave work for the day. Since then, Johannes has replied, so my response is now rather redundant. But I am sending it now anyway to supplement Johannes's reply.</div>
<div style><br></div><div style><br></div><div class="gmail_extra"><div class="gmail_extra">> 1- what does the pom version mean, and which version should I use, I</div><div class="gmail_extra">> found different numbers in the examples.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The pom.xml of minimal-ij1-plugin inherits from a parent called pom-scijava. This parent POM defines and configures many things so that the POMs of individual plugin projects are shorter (i.e., so they don't have to repeat things).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The version of pom-scijava (1.27 as of this writing) indicates the version of that parent POM. We occasionally improve the parent POM, adding and tweaking it. When we do so, its version increases. I suggest leaving the version that same as what's in minimal-ij1-plugin, since that refers to the latest version. Future 1.x versions will be backwards compatible, so if you later notice that we have updated minimal-ij1-plugin to e.g. 1.43, you can (optionally) update your plugin to that version as well.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The version of minimal-ij1-plugin itself (1.0.0 as of this writing) is the version of your plugin. This string is appended to the JAR file name (e.g., minimal-ij1-plugin-1.0.0.jar), so that you can differentiate between multiple versions of your plugin. Use whatever versioning scheme you want.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">However, once you become more comfortable with Maven, I suggest using a SNAPSHOT version during development [1], and a release (i.e., non-SNAPSHOT) version when distributing your plugin. The reason is to avoid two different JAR files both called "my-plugin-1.2.3" but with different contents. (This is part of what Maven calls *build reproducibility*.)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">> 2- how is the imagej version determined</div><div class="gmail_extra">> (<version>${imagej1.version}</version>) ?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The string "${imagej1.version}" is a property that gets replaced with the actual value. This value is defined in the pom-scijava parent configuration. Currently the value is "[1.45s,)" which means "the latest release version you can find equal to or greater than 1.45s."</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Browse the latest pom-scijava at:</div><div class="gmail_extra"> <a href="https://github.com/scijava/scijava-common/blob/master/pom-scijava/pom.xml" target="_blank">https://github.com/scijava/scijava-common/blob/master/pom-scijava/pom.xml</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Browse the available versions of ImageJ 1.x at:</div><div class="gmail_extra"> <a href="http://maven.imagej.net/content/repositories/releases/net/imagej/ij/" target="_blank">http://maven.imagej.net/content/repositories/releases/net/imagej/ij/</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">As of this writing, 1.47h is the latest available version, so that's the one Maven will use with your plugin.</div><div class="gmail_extra"><br></div>
<div class="gmail_extra"><br></div><div class="gmail_extra">> 3- During build I see the following message: Property</div><div class="gmail_extra">> 'imagej.app.directory' unset; Skipping copy-jars</div><div class="gmail_extra">
<div class="gmail_extra">> So it must be possible to place the jar into my own imagej installation, how?</div><div><br></div></div><div class="gmail_extra">This is part of the new imagej-maven-plugin (enabled for you by pom-scijava). As you suspected, it copies your plugin's JAR file to your ImageJ plugins folder. But you have to specify where:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"> mvn -Dimagej.app.directory=/Applications/ImageJ.app</div><div class="gmail_extra"><br></div><div class="gmail_extra">One way to do that in NetBeans is to right-click your project, select Custom > Goals... which brings up the Run Maven dialog box. Then specify "install" for the Goals and "-Dimagej.app.directory=/Applications/ImageJ.app" for the Properties.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">I haven't tested this though; the imagej-maven-plugin is very new and we are still finalizing how it will work. So please proceed with that in mind.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">> 4- During run an imagej jar from ~/.m2.... is started, is this only</div><div class="gmail_extra">> for test/debug? how to use my own imagej?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">> 5- The process_pixels application does not quit properly, I have to</div>
<div class="gmail_extra">> stop it from netbeans.</div><div class="gmail_extra"><br></div><div class="gmail_extra">...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">
> 6- My software is dependent from other plugins, such as particle8 from</div><div class="gmail_extra">> Gabriel Landini's Morphology, can/is this incorporated in the imagej</div><div class="gmail_extra">> maven repository?</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">> 7- In my ant script I'm using a call to svnversion, in order to place</div>
<div class="gmail_extra">> the latest build number and date in the about box. Can this be done in</div><div class="gmail_extra">> maven?</div><div><br></div><div>In general, you can call any needed Ant functionality using the maven-antrun-plugin [2]. However, for your requirement here, you won't need it.</div>
<div><br></div><div>The pom-scijava parent uses the buildnumber-maven-plugin to embed the SCM revision and date in the JAR manifest. You can enable this behavior by adding the following lines to your POM:</div>
<div><br></div><div> <plugins></div><div><div> <plugin></div><div> <groupId>org.codehaus.mojo</groupId></div><div> <artifactId>buildnumber-maven-plugin</artifactId></div>
<div> </plugin></div><div> </plugins></div><div><br></div><div>Then, your About dialog box can access the information from the JAR manifest using the java.util.jar.Manifest class.</div><div>
<br></div><div>You can see how we use it in ImageJ2 here:</div><div> <a href="https://github.com/imagej/imagej/blob/7ffe00ef/core/core/src/main/java/imagej/util/Manifest.java" target="_blank">https://github.com/imagej/imagej/blob/7ffe00ef/core/core/src/main/java/imagej/util/Manifest.java</a></div>
</div><div><br></div><div>Or you can use that ImageJ2 Manifest class directly if you are willing to add a dependency to ij-core to your POM:</div><div><br></div><div> <dependencies></div><div>
<dependency></div><div> <groupId>${imagej.groupId}</groupId><br></div><div> <artifactId>ij-core</artifactId><br></div><div> <version>${imagej.version}</version><br>
</div><div> </dependency></div><div> </dependencies><br></div><div><br></div><div>For more information about Maven, see:</div><div> <a href="http://developer.imagej.net/learning-maven" target="_blank">http://developer.imagej.net/learning-maven</a></div>
<div> <a href="http://maven.apache.org/guides/getting-started/index.html" target="_blank">http://maven.apache.org/guides/getting-started/index.html</a><br></div><div><br></div><div>Regards,</div><div>Curtis</div><div>
<br></div><div>[1] <a href="http://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it" target="_blank">http://stackoverflow.com/questions/5901378/what-exactly-is-a-maven-snapshot-and-why-do-we-need-it</a></div>
<div class="gmail_extra">[2] <a href="http://maven.apache.org/plugins/maven-antrun-plugin/" target="_blank">http://maven.apache.org/plugins/maven-antrun-plugin/</a></div><div class="gmail_extra"><br></div><br><div class="gmail_quote">
On Mon, Jan 14, 2013 at 2:21 PM, Polder, Gerrit <span dir="ltr"><<a href="mailto:gerrit.polder@wur.nl" target="_blank">gerrit.polder@wur.nl</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">sorry for crosspost, asked this already on the ImageJ list, but Wayne directed me to here.<br>
<br>
I am using netbeans with ant as the building system quite some time now (on Mac OS X).<br>
During the last developer conference there was a strong emphasis on maven as build/dependency tool, so I decided to give it a try.<br>
I started with the process_pixels example which compiles and runs nice, but I have some questions.<br>
Sorry if these are dumb questions, but I scanned through the documentation and didn't find answers quickly.<br>
<br>
1- what does the pom version mean, and which version should I use, I found different numbers in the examples.<br>
2- how is the imagej version determined (<version>${imagej1.version}</version>) ?<br>
3- During build I see the following message: Property 'imagej.app.directory' unset; Skipping copy-jars<br>
So it must be possible to place the jar into my own imagej installation, how?<br>
4- During run an imagej jar from ~/.m2.... is started, is this only for test/debug? how to use my own imagej?<br>
5- The process_pixels application does not quit properly, I have to stop it from netbeans.<br>
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?<br>
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?<br>
<br>
thanks a lot,<br>
Gerrit.<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
</blockquote></div><br></div></div>