Login  Register

Re: AW: AW: AW: How to handle dependencies

Posted by dscho on Jan 27, 2014; 2:42pm
URL: http://imagej.273.s1.nabble.com/Re-AW-How-to-handle-dependencies-tp5006206p5006297.html

Hi Heinrich,

On Mon, 27 Jan 2014, Grabmayr, Heinrich wrote:

> 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.jar
>
> 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

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html