Sorry to see you suffer here on a Saturday evening.
Maven has simplified my life with Java soooo much, maybe I can share at least the bit I understood about it… even if I understand you have found a solution that works for you.
I think you might be conflating two concepts here:
- What maven calls
install is the storage of a compiled jar file (at a specific version) in your
~/.m2/ folder, the “Maven repository”.
- What you call “compile into Fiji.app/jars” is a separate “goal”,
copy-jars – defined by the
scijava-maven-plugin – that copies the jar file into a given Fiji installation (or more general: any SciJava application), in addition to the
installation into the maven repository that happened earlier during the build.
Just because you copied the
SNAPSHOT version into your Fiji installation, it doesn’t mean that when you compile
imglib2-algorithm, it will know about that new version, because it will use the versions defined in its own
pom.xml (either explicitly, or inherited by
pom-scijava, see explanation below).
Please mind your words. You’re free to compile with javac and it will work with Fiji, nobody forces you to work with Maven. Nevertheless, I have to say that it simplified the development workflows of a lot of people I know (including myself), who would probably be struggling with dependency issues and version skews even more than with Maven.
That’s because it uses the version managed by the
pom-scijava parent. That usually makes it easier because you don’t have to think about which version it is that everybody else in the Fiji universe is currently using.
Nonetheless, you can always override the managed (inherited) version property:
If you depend on
SNAPSHOT versions (which you have to, because there’s no release version yet containing
RealType.pow), you will have to skip the
maven-enforcer-plugin temporarily by running Maven like this:
mvn clean install -Denforcer.skip
Instead of editing the
imglib2-algorithm, you can also define the version property directly when building from the command line:
mvn clean install -Denforcer.skip -Dimglib2.version=5.10.0-SNAPSHOT
I sincerely hope this will help anyone who stumbles upon this forum topic in the future