Am 2023-02-09 um 12:00 schrieb Falko Modler:
Hi all,
I'm currently trying to get gitflow-incremental-builder (GIB) running in
a GitHub Action using Maven 3.9.0 (and Java 17).
https://github.com/gitflow-incremental-builder/gitflow-incremental-builder
GIB is a maven extension that shall be usable in the following "flavors":
1. as a plugin with <extensions>true</extensions>
2. or as via extensions in pom.xml
3. or as a "core" extension via extension.xml
which are all working fine with Maven 3.6.3 and 3.8.7.
With 3.9.0 I was initially seeing the following weird exception in 2 of
3 integration tests:
1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at
LocatorWiring
but
UnchangedProjectsRemover.downstreamCalculator(UnchangedProjectsRemover.java:43)
is not @Nullable
at LocatorWiring
at
UnchangedProjectsRemover.downstreamCalculator(UnchangedProjectsRemover.java:43)
\_ for field downstreamCalculator
The two failing tests are the ones for flavor 1 and 2, meaning that the
core extension case did not fail!
To add even more confusion: I don't see any issues locally on two
different Ubuntu 22.04 systems (one natively and one via WSL2).
Anyway, after trying a few other things without luck, I tried adding an
explicit dependency to plexus-utils which does fix this general issue!
But that brings back another issue I already had before 3.9.0 in a
specific use case / code path _and only for the third flavor_ (core
extension):
java.lang.ClassCastException: class org.codehaus.plexus.util.xml.Xpp3Dom
cannot be cast to class org.codehaus.plexus.util.xml.Xpp3Dom
Now, with 3.9.0 I can fix this issue by setting the new property in the
integration test extension.xml:
<classLoadingStrategy>plugin</classLoadingStrategy>
But users cannot do that in 3.8.7.
Long story short, I don't see how I can cover both 3.8.7 _and_ 3.9.0 for
all cases:
- If I don't add plexus-utils, I break flavors 1 & 2 with Maven 3.9. I
could try to document that users shall add plexus-utils on their own,
but that's only possible for the plugin case (flavor 1).
- If I add plexus-utils, I break flavor 3 with Maven <=3.8.7 because
users cannot set classLoadingStrategy yet and there is also no way to
exclude plexus-utils via extension.xml.
Am I missing an option? I really don't want to publish two different
variants of GIB (one with and one without plexus-utils dependency).
It's also way too early to drop support for Maven <=3.9.
Thank you for the in-depth analysis. This is ugly, I agree. Have you
tried to back port the class loading strategy from gnodet@ back to
3.8.x? Please try that, if that works I would be inclined to include
this with 3.8.8 since it won't change the behavior as far as I understand.
Would that solve the problem with 3.8.x, 3.9.x and 4.x?
M