-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Maven Plugin - the option to set extraClasspath in the plugin configuration isn't working randomly #11732
Comments
Running with
|
I wonder if maven is chosing between matching these 2 methods on
and is somehow chosing the second one and trying to directly convert the |
@olamy can you take a look at the stacktrace and see if you can understand what's going on? |
TBH I don't know how this could work with |
uhm not sure about the |
haha the javadoc here says
After some test I can confirm the returned order may be different when Maven try to figure the setter method associate with the field name see https://github.com/eclipse/sisu.plexus/blob/5e8587eac8c4c079566dcd0ccb0d5dba40cb4169/org.eclipse.sisu.plexus/src/main/java/org/eclipse/sisu/plexus/CompositeBeanHelper.java#L269 so sometimes the converter will pick the right method and sometimes not. |
using |
@rinnnn you can have a look at the patch here eclipse-sisu/sisu.plexus#52
please note my Maven home $M2_HOME=~/.sdkman/candidates/maven/3.9.6 |
Thanks, it works well for me. Just a note for others: for it to work one needs both:
|
FTR Apache Maven issue https://issues.apache.org/jira/browse/MNG-8116 |
Unsure can this issue be fixed in Maven 3.9.7, as its release is scheduled for upcoming days, while this is downstream bug in Eclipse Sisu Plexus Shim. Moreover, Plexus Shim cannot be released "alone", it must go with with Eclipse Sisu, so that would be two releases downstream Maven to have 3.9.7 possible to happen. Would it be simple(r) to just deprecate one of double named methods and introduce one like one singular (for String) and plural (for list) maybe? |
The more natural, modern and elegant method here is |
@cstamas that method has been released in our public api, so no, we can't just delete it. I'm quite surprised this problem exists as it seems a pretty fundamental concept in object oriented programming not to be supported? |
@janbartel am not questioning method overload as valid thing in Java, am just stating that here you deal with ton of layers, from Mojo config, Maven internal, Plexus (that is phased out) and finally Sisu as DI implementation. This problem seems existed in whole Maven 3.x line. I avoided overloading mojo config in all my life, that's all. Exposing APIs like this is a brave thing, that's all am saying 😄 |
@cstamas heh heh, I wasn't expecting a problem as jetty xml configuration code has dealt with overloaded methods for 20+ years 😉 |
fixed with eclipse-sisu/sisu.plexus#52 |
Apache Maven 3.9.8 has been released |
Jetty version(s)
jetty 12.0.8
Jetty Environment
Is not relevant for the issue
Java version/vendor
Is not relevant, Java 17 in my case
OS type/version
Is not relevant, Linux in my case.
Description
Exactly the same issue as in the #7970, just a newer jetty version.
How to reproduce?
With the attached maven project
test-extra-classpath.zip
Run the following command in Linux (the command is easy to adapt for other systems, it is only needed because the issue happens randomly, so we need to repeatedly run the project until it fails):
Wait for the project to eventually fail with the
Cannot create instance of class org.eclipse.jetty.util.resource.Resource
error (can be after tens of iterations). On this sample project it fails 1 in say 20 times, but on my big project it is vice-verse (fails 19 of 20 times).Here is the sample output (only the last i.e. failed iteration):
The text was updated successfully, but these errors were encountered: