-
Notifications
You must be signed in to change notification settings - Fork 268
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
display-plugin-updates-005 and -006 fail with maven older than 3.8.4 #850
Comments
effectiveVersion is null at https://github.com/mojohaus/versions/blob/master/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java#L407 when running with parallel threads |
Some clarification of how invoker works. For each project / test invoker execute new Sow when we use Each versions-m-p test can interact with local Maven repository which is not synchronized by multi process. |
In that case this is something I observe on my machine only; and I see it's not limited to parallel use of the invoker. In many runs, it-display-plugin-updates-005, it-display-plugin-updates-006, it-rules-via-wagon-001 (which uses the display plugin updates mojo), all fail on an NPE at https://github.com/mojohaus/versions/blob/master/versions-maven-plugin/src/main/java/org/codehaus/mojo/versions/DisplayPluginUpdatesMojo.java#L623 because one of the versions is null, which boils down to the plugin version being null and the parentVersions not containing the version for the plugin. Looking for the root cause of that. |
We can use https://maven.apache.org/plugins/maven-invoker-plugin/examples/parallel-projects-execution.html |
Managed to produce the problem consistently using Maven 3.2.5. The problem appears not to occur on Maven 3.8.6. |
In version 3.8.6, the version of
In the older version however, it doesn't get resolved. I don't know how much consistent that is. I haven't checked how that resolution is done exactly (DefaultPluginVersionResolver from maven-core), but that might depend on the version of Maven. The latest version of Maven when the problem occurs is 3.8.3. It appears to have been fixed in 3.8.4. |
I think it is quite safe to mitigate (I am specifically not using the term "fix") the problem by using String.valueOf instead of simply dereferencing the String object which may be null. The result is then:
|
…inst a NPE in case the effective version of a plugin is not specified
…inst a NPE in case the effective version of a plugin is not specified
…PE in case the effective version of a plugin is not specified
While working on #848 I've noticed that the project is very sensitive to concurrency issues. Integration tests often fail when run multi-threaded. To be checked and sanitized.
By the way, this is a very old issue, a comment regarding that has been sitting in pom.xml for quite some time now.
The text was updated successfully, but these errors were encountered: