Posted by
Heerpa on
Feb 12, 2014; 1:44am
URL: http://imagej.273.s1.nabble.com/Re-AW-How-to-handle-dependencies-tp5006206p5006493.html
Hi List,
Just in case somebody has the same issue at some point in the future:
Previously, I had the problem of dependencies not getting deleted even when
I set the property
<delete.other.versions>true</delete.other.versions>
I now noticed that I had used the pom-scijava 1.51 as a parent and had
thought this was the current version. Using version 1.129, the other
versions of dependencies are deleted very nicely in the set IJ folder.
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>1.129</version>
<relativePath />
</parent>
For this change to work, I also had to change
<!-- <repository>
<id>imagej.releases</id>
<url>
http://maven.imagej.net/content/repositories/releases</url>
</repository>-->
To
<repository>
<id>imagej.public</id>
<url>
http://maven.imagej.net/content/groups/public</url>
</repository>
Otherwise, maven would not find the dependencies any more.
Ciao, Heinrich
-----Original Message-----
From: Grabmayr, Heinrich
Sent: Montag, 27. Januar 2014 16:19
To: Johannes Schindelin
Cc: 'Heinrich Grabmayr'; 'ImageJ Interest Group'
Subject: AW: AW: AW: AW: How to handle dependencies
Hi Johannes
>
> > Maven now copies the plugin jar and the needed dpendencies into the
> > copy of Fiji I usually work with. When I now start Fiji, it tells me
> > that there are multiple conflicting dependencies and when I update
> > Fiji, there are CriticalErrors, also about multiple jars.
> > e.g.
> > CriticalError: plugins/loci_plugins-4.4.10.jar Multiple
> > locally-modified versions of plugins/loci_plugins-4.4.10.jar exist:
> > C:\Users\ne85tib\Desktop\Fiji.app\plugins\loci_plugins-4.4-SNAPSHOT.
> > ja
> > r
> >
> > Do I understand correctly that I need to use exactly the same
> > versions in maven as are used in the current Fiji plugin
> > distribution? I tried to use version 4.4.10 of loci_plugins but Maven
did not find that somehow.
>
> The problem is that there are multiple versions of the same dependencies.
> If all of those dependencies are developed according to SemVer
> (
http://semver.org) it is often possible to simply use the newest
> version (SemVer suggests to indicate via the version number whether it
> is safe to do
> so: bug fixes increase the micro version, backwards-compatible
> enhancements increase the minor version, backwards *incompatible*
> changes increase the major version).
>
> Sadly, SemVer is not used for all of the components in the Fiji
> universe, most notably for ImgLib2 and ImageJ 1.x itself.
>
> Having said that, Bio-Formats seems to be developed according to
> SemVer, so it should be totally safe to tell the imagej-maven-plugin
> to delete other versions when copying a dependency: You only need to
> set the property "delete.other.versions" to "true". Example:
>
> mvn -Dimagej.app.directory=$HOME/Desktop/Fiji.app \
> -Ddelete.other.versions=true
I am using NetBeans, and just select "Clean and Build" when I want to
compile the code / execute the pom. Therefore I guess command line is not
suitable. Thus, I included the property
<properties>
<imagej.app.directory>C:\Users\ne85tib\Desktop\Fiji.app</imagej.app.director
y> <!-- Path to fiji here for testing the plugins and uploading to the
server -->
<delete.other.versions>true</delete.other.versions> <!-- found
on
http://imagej.1557.x6.nabble.com/Eclipse-Maven-workflow-depencies-copied-to-Fiji-app-directory-td5005804.html -->
</properties>
into my pom.xml (which is taken from the minimal ij plugin-github
repository), its parent is
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>1.51</version>
</parent>
However, the other versions are not deleted - the same problem remains.
NetBeans output tells me about which dependencies it copies during the
copy-jars task but there is nothing on checking or deleting other versions.
Do you have any more suggestions?
Best,
Heinrich
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html