-
Notifications
You must be signed in to change notification settings - Fork 267
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
Using goal "versions:use-next-releases" with "Apache Maven Invoker" fail on maven-3.8.7 #890
Comments
The goal does not find any newer versions of your dependency. Due to a regression introduced in #813 (introduced in version 2.14.0), it now raises an ArrayOutOfBoundException, which I'm going to fix now. Please try with any release prior to 2.14.0 (e.g. 2.13.0). Did you expect to find any newer version of the dependency artifact? |
I manualy change one of dependency to use previous release and I have the same problem. |
Could you show me the logs of your using 2.13.0 and reaching the same problem? |
I am not sure I understand I just upgrade from 3.8.6 to 3.8.7. No problems with 3.8.6. |
Background info: The problem occurred when I removed the check on Optional.of(versions.getNewerVersions(dep.getVersion(), false)[0]) So the fix uses Stream.findFirst() instead: Arrays.stream(versions.getNewerVersions(dep.getVersion(), false)).findFirst() |
What do I need to do ? |
@eitan-rosenberg there are two things here:
To do 2), you need to first request an account by mailing to [email protected] |
OK |
By the way, you don't need to delete your old maven installation, you can just execute Granted, I don't know exactly how you're using Maven. |
I am one man shop so I just replace the old stuff with the new one. |
That's great! Could you tell me a bit how you're using Maven? You don't need to launch it from Java. You can just type |
I am outside taking a walk..
I will come back to you later
Get Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: Andrzej Jarmoniuk ***@***.***>
Sent: Saturday, December 31, 2022 10:31:22 AM
To: mojohaus/versions ***@***.***>
Cc: Eitan Rosenberg ***@***.***>; Mention ***@***.***>
Subject: Re: [mojohaus/versions] Using goal "versions:use-next-releases" with "Apache Maven Invoker" fail on maven-3.8.7 (Issue #890)
That's great!
Could you tell me a bit how you're using Maven? You don't need to launch it from Java. You can just type mvn versions:use-next-releases to use the latest version of the plugin or mvn org.codehaus.mojo:versions-maven-plugin:<version>:use-next-releases to use the <version> version.
—
Reply to this email directly, view it on GitHub<#890 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALSCJRURUE77QYZNYUK7CWLWP7VNVANCNFSM6AAAAAATNM7K5E>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Interesting, I need a solid reproducer to verify the bug with Maven 3.8.7. |
I am back from the sunny outside |
We can use Zoom if you want |
Hi, How I use Maven: AS I told you, I am a retired programmer. Now days I use Java as a mental exercise... I have many independent projects that use a variety of dependencies that covers desktop, clients,servers etc. I use Maven only for dependencies maintenance. I wrote some code that is making my life easier... My environment:
|
I see. Thanks for this info. So I guess you're invoking the plugin from a bespoke Java routine and parsing the output of "display-dependency-updates" and acting on it. If that's the case, perhaps "dependency-update-report" would be a better fit with its XML output -- easy to parse and act upon. It would be nice to have an API to be able to act on the intermediate results on update results, but an API is not there yet (still in plans). |
@ajarmoniuk Please ping me when you can boil down that it is not this plugin, but Maven 3.8.7. |
@michael-o all but the ArrayIndexOutOfBoundException reported at the beginning is not about the plugin, but about Maven 3.8.7 And for the array overflow error there's already a trivial PR ready to be reviewed. |
@eitan-rosenberg I suggest that we move this discussion elsewhere. This is very off-topic. |
@slawekjaranowski please review the PR and close if ready :) |
@ajarmoniuk this #891 was merged - should be linked with this issue? |
Ok, should we close this ... ? |
We could try. @eitan-rosenberg could you please modify the execution parameters of Maven to include debug output, and attach the debug log here? The option to do so is |
Also, ideally the "aggregated" pom.xml. |
I will set: from javadoc Sets the debug mode of the Maven invocation. Equivalent of -X and --debug |
The "aggregated" pom.xml is just for "versions:display-dependency-updates" . |
Log +debug for "versions:display-dependency-updates" |
Log +debug for "versions:use-next-releases" |
Some dependencies which we can't really trace/work upon: <dependency>
<groupId>JOOQ.Coder</groupId>
<artifactId>JOOQ.Coder</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_JARS}/JOOQ.Coder/JOOQ.Coder.jar</systemPath>
</dependency>
<dependency>
<groupId>MyEmployee.jar</groupId>
<artifactId>MyEmployee.jar</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_JARS}/myEmployee/MyEmployee.jar</systemPath>
</dependency>
<dependency>
<groupId>MyFileLock.jar</groupId>
<artifactId>MyFileLock.jar</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_JARS}/myFileLock/MyFileLock.jar</systemPath>
</dependency>
<dependency>
<groupId>MyJava_FX_Tools.jar</groupId>
<artifactId>MyJava_FX_Tools.jar</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_JARS}/myJava_FX_Tools/MyJava_FX_Tools.jar</systemPath>
</dependency>
<dependency>
<groupId>MyLogger.jar</groupId>
<artifactId>MyLogger.jar</artifactId>
<version>1.0</version>
<scope>system</scope>
<systemPath>${env.JAVA_JARS}/myLogger/MyLogger.jar</systemPath>
</dependency> |
Just kill them, it is homegrown |
The "aggregated" pom.xml is just for "versions:display-dependency-updates" . |
Results for display-dependency-updates from 2.15.0-SNAPSHOT are the same across 3.8.6 and 3.8.7:
So, I was unable to reproduce the problem with the patched version. However, the problem does appear with 2.14.2. So, the array overflow was the reason and had nothing to do with Maven. |
@eitan-rosenberg if you want, you can pull the newest snapshot from here (it's already patched) or use 2.13.0, which does not have the bug. |
So no Maven issue here? |
No Maven issue. |
Why did 3.8.7 enable the problem though? 🤔 |
AH, it did not, the problem also appears on 3.8.6. So it was a false track. |
Did you manage to reproduce the error ? |
Yes, on both 3.8.7 and 3.8.6. It does not appear if you use an older version of the plugin or if you pull the newest snapshot and use it. |
Great news.... |
It's not Maven. As for the plugin, I guess in a couple of weeks. But you can just change the way how you ibvoke the plugin; Use |
I change the code like you sugested private static final String VERSIONS_USE_NEXT_RELEASES = "org.codehaus.mojo:versions-maven-plugin:2.13.0:use-next-releases"; invocationRequest.setGoals(List.of(VERSIONS_USE_NEXT_RELEASES)); It is working !!! |
You can either pull it using Eclipse (import a new project using the VCS import wizard and then git, checkout from https://github.com/mojohaus/versions.git or [email protected]:mojohaus/versions.git if you imported a key), or download the compressed sources from https://github.com/mojohaus/versions/archive/refs/heads/master.zip And then you can compile and install them somewhere on your local directory using Then your local repository will contain |
I change the code like you sugested: private static final String VERSIONS_USE_NEXT_RELEASES = "org.codehaus.mojo:versions-maven-plugin:2.13.0:use-next-releases"; invocationRequest.setGoals(List.of(VERSIONS_USE_NEXT_RELEASES)); It is working !!! |
@slawekjaranowski we can close this one. Happy New Year, everyone! |
Hello, Maven 3.9.0 came out today. I assume that versions-maven-plugin:2.15.0 is not included in Maven 3.9.0. Regards. |
Hi. It's not a part of Maven. |
Ok thanks, |
Good morning |
Hi,
I just replaced apache-maven-3.8.6 with apache-maven-3.8.7.
I got a fresh repository.
I am using org.apache.maven.shared.invoker.DefaultInvoker to run maven programmatically for some years now with no problems.
I post my goals using Apache Maven Invoker using invocationRequest (org.apache.maven.shared.invoker.DefaultInvocationRequest).
the invocationRequest is set to show Errors (invocationRequest.setShowErrors(true));
When using "versions:use-next-releases" the invoker fail.
I am including the log:
Document07.txt
please help...
Happy new year
The text was updated successfully, but these errors were encountered: