Dear Maven gurus.
Lately I was thinking about migrating from ant to maven (+ transition to Java-8 update site). Unfortunately I am not maven expert and I have lots of problems.
Currently plugin is using old style for ImageJ1 plugins and Ant is used to build two targets (jar files):
- ImageJ (which crate big jar file including all dependencies)
- Fiji (it includes in final jar only those jars which are not shipped with Fiji directly like super-csv-2.4.0.jar and its further dependencies)
Yes, this is a little bit a mess especially caused by manual management of included/not included jar files. What is not so nice: it uses a few jars which are not available in maven like CMA-ES and that is a reason of putting that stuff into final plugin jar file.
I have a few questions how to go as smoothly as possible to have something working nicely:
What pom should I have?
I still would like to have plugin working with both - ImageJ and Fiji - so I guess that correct parent pom would be:
<parent> <groupId>net.imagej</groupId> <artifactId>pom-imagej</artifactId> <version>15.7.1</version> <relativePath /> </parent>
What version of parent pom should I use (having Java-8 in mind)? Especially to deal with problems like changing package name problem described HERE. What is a policy to choosing ‘right’ version of parent pom now and in future (when/basing on what it should be updated)?
How to deal with dependecies?
I have moved code around and created some initial pom.xml: MosaicSuite git
This pom.xml seems to work -> it compiles and test are passing. Unfortunately because of things described above I need to use maven-shade-plugin to bundle all in one big jar file (currently just for simplicity I take it all into jar). If this is not done I get of course NoClassDefFoundError. Should I have different build targets for ImageJ and FIji?
Is this problem with dependencies solveable or…?
Could you provide me with some hints how to deal with it? Should I be aware of something and/or maybe such transition is not recommended?
Well, my current goal is to have project mavenized as easily as possible and it is supposed to be one baby step in (hopefully) good direction. But of course if you have some suggestions to what next step should be please share!