-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch to Maven Artifact Resolver Ant tasks #3923
Conversation
- declare new resolver namespace and point to the new taskdef - remove the maven.repo.local handling (supported by default) - declare the minimum set of remote repositories to compile - drop the mvn-init task and include resolve in the relevant tasks - declare top-level install-pom task to use local pom-bio-formats
This is a requirements for components liked turbojpeg which have no dependencies as the javac tasks fails with some form of NPE when fetching the classpath refid
Uses archives, zips and path with the classpath reference. However it is very slow and can probably be optimized
This is primarily for performance reasons as the previous command acting on the classpath refid was very slow - see also https://bz.apache.org/bugzilla/show_bug.cgi?id=43144
The overall approach looks sensible to me, happy to see it removed from draft and included in the CI |
Quick test of |
One failure in the daily CI build - see https://merge-ci.openmicroscopy.org/jenkins/job/BIOFORMATS-image/1394/console
It's effectively a side-product of the interaction of this PR and #3815 where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the changes here look to be sensible and the PR has been included as part of the CI for a while now without issues. I manually tested each of the main ant targets and the results were as expected. All the generated artefacts match those produced without the PR and tests all run without issue. PR is good to merge from my side.
The ongoing effort to support Java 17 (#3815) in Bio-Formats highlighted issues with the Maven Ant Tasks component which is used by the Ant build system to retrieve the dependencies from the POM files. More specifically, the upgrade to
org.openmicroscopy:ome-codecs:0.4.0
to consume ome/ome-codecs#23 fails with the following stack trace:The Maven Ant Tasks component has been retired in 2014 and it's almost unexpected that we have been able to use it for so long without issues. This leaves two options to resolve this build problem:
Although retiring the Ant build system comes up periodically in discussions with @ome/formats team, my primary concern is that it is still not properly scoped but we know retiring it will impact developers, CI and release process minimally. While for several components there is a large overlap of the Ant tasks with the standard Maven lifecycle, there are a number of critical tasks which are currently only defined in Ant including the generation of various archives/bundles (bftools, bfmatlab) and the running of the automated tests.
This PR investigates the first option to modernize the Ant dependency management using Maven-compatible tools and allow us to deliver Java 17 support.
Overall, the changes should be straightforward:
maven-ant-tasks
is replaced by themaven-resolver-ant-tasks
uberJAR and declared in the appropriate Ant configuration filesmvn-init
task that was usingartifacts:dependencies
to create compile/test/runtime classpaths is retired andresolver:resolve
is directly involved in thecompile
andcompile-tests
tasks. Thecompile.classpath
,test.classpath
and runtime.classpath` references should remain unchangedartifact:install
is retired in favor ofresolver:artifacts
andresolver:install
runtime.classpath
in a temporary build directory and then rezipping it usingzipfileset
, primarily for performance reasons