You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Falko Modler <f....@gmx.net> on 2023/02/09 11:00:51 UTC
Maven 3.9.0 plexus-utils issue in extension
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.
References:
- initial PR:
https://github.com/gitflow-incremental-builder/gitflow-incremental-builder/pull/644
- troubleshooting PR:
https://github.com/gitflow-incremental-builder/gitflow-incremental-builder/pull/645
Thanks & cheers,
Falko
Re: Maven 3.9.0 plexus-utils issue in extension
Posted by Falko Modler <f....@gmx.net>.
Correction:
> It's also way too early to drop support for Maven <=3.9.
"for Maven < 3.9".
Also sorry for the formatting mess, I copied the error directly from the
console.
Cheers,
Falko
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven 3.9.0 plexus-utils issue in extension
Posted by Michael Osipov <mi...@apache.org>.
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
Re: Maven 3.9.0 plexus-utils issue in extension
Posted by Falko Modler <f....@gmx.net>.
> Maybe really a backport is the way to go. Please check in and out and
> I will happily merge if this fixes the problem for components like yours.
I was able to backport and test it sucessfully, see
https://github.com/apache/maven/pull/999
Btw, I'll explore a reflection hack to mitigate the impact on GIB users,
but the above change would make sense anyway (if there's ever a 3.8.8).
Cheers,
Falko
Am 10.02.2023 um 19:44 schrieb Michael Osipov:
> Am 2023-02-10 um 18:55 schrieb Falko Modler:
>> Hi Michael,
>>
>>> Have you tried to back port the class loading strategy from gnodet@
>>> back to 3.8.x?
>> Not yet. First, I'm looking for solutions without touching Maven itself
>> but there might be none in this case.
>>
>> I was actually thinking myself whether that feature could be backported,
>> so good you mentioned it.
>>
>> It would probably make it work with 3.8.8 (and 3.9+), but obviously not
>> with <=3.8.7.
>>
>> Btw, I think that 1.1.0 xsd hasn't been uploaded yet, or has it?
>
> Done, Tamás simply did forget to upload. No issue.
>
> This should be it:
> * https://issues.apache.org/jira/browse/MNG-7160
> *
> https://github.com/apache/maven/commit/a1d8a07e08927a754f6dd72d5729d85ae15d3e63
>
> It is almost two years old and has been reported against 3.6.x as
> well. Maybe really a backport is the way to go. Please check in and
> out and I will happily merge if this fixes the problem for components
> like yours.
>
> Michael
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org
Re: Maven 3.9.0 plexus-utils issue in extension
Posted by Michael Osipov <mi...@apache.org>.
Am 2023-02-10 um 18:55 schrieb Falko Modler:
> Hi Michael,
>
>> Have you tried to back port the class loading strategy from gnodet@
>> back to 3.8.x?
> Not yet. First, I'm looking for solutions without touching Maven itself
> but there might be none in this case.
>
> I was actually thinking myself whether that feature could be backported,
> so good you mentioned it.
>
> It would probably make it work with 3.8.8 (and 3.9+), but obviously not
> with <=3.8.7.
>
> Btw, I think that 1.1.0 xsd hasn't been uploaded yet, or has it?
Done, Tamás simply did forget to upload. No issue.
This should be it:
* https://issues.apache.org/jira/browse/MNG-7160
*
https://github.com/apache/maven/commit/a1d8a07e08927a754f6dd72d5729d85ae15d3e63
It is almost two years old and has been reported against 3.6.x as well.
Maybe really a backport is the way to go. Please check in and out and I
will happily merge if this fixes the problem for components like yours.
Michael
Re: Maven 3.9.0 plexus-utils issue in extension
Posted by Falko Modler <f....@gmx.net>.
Hi Michael,
> Have you tried to back port the class loading strategy from gnodet@
> back to 3.8.x?
Not yet. First, I'm looking for solutions without touching Maven itself
but there might be none in this case.
I was actually thinking myself whether that feature could be backported,
so good you mentioned it.
It would probably make it work with 3.8.8 (and 3.9+), but obviously not
with <=3.8.7.
Btw, I think that 1.1.0 xsd hasn't been uploaded yet, or has it?
PS: You answered me diretly but I've just replied to the list. Hope
that's ok.
Cheers!
Am 10.02.2023 um 09:03 schrieb Michael Osipov:
> Am 2023-02-09 um 12:00 schrieb Falko Modler:
>> ...
>
> 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
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org