-
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
Possible issue which could raise NPE. #604
Comments
I am encountering the same. |
Please try with the latest version of plugin. Please provide reproduction steps, command, simple project, etc. |
I've spent too long trying to reproduce or arrive at some explanation of the issue, it boils down to having no version in one of the reactors, which is weird, since this normally shouldn't be possible. Both on the latest version and on 2.8.1. As said above, please provide reproduction steps, the command arguments (or plugin configuration) and a simple project (set of poms) on which the issue appears. |
So sorry about that and sorry for delay... If I remember well, it was in case of multi-module project where some parents was not a child of aggregator like in #605. I didn't give any information about how to reproduce because I was thinking that just looking at code you could know if this line of code looks as normal or if this sounds not so good. Sorry about that ... 🙏 If needed, I can try to reproduce the bug but as it was a strange (or maybe nortsupported or not wanted to support) use case, I'm not sure it worth it ? |
I've managed to arrive at the same case -- stacktrace-wise. That is: NPE arising from DependencyVersionChanger if an artifact version in reactor is null. To me, this is a very corner case, and my reproduction attempt actually does not modify any pom.xml files, but it does produce an NPE if not patched. The test project consists of a parent and a child pom with something in dependency management to have the DependencyVersionChanger working. parent: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>localhost</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>localhost</groupId>
<artifactId>dummy-api</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
</dependencyManagement>
<modules>
<module>child</module>
</modules>
</project> child: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>localhost</groupId>
<artifactId>test-artifact</artifactId>
<version>1.0</version>
</parent>
<artifactId>child</artifactId>
</project> options:
With these settings, we arrive at the very same stack trace. That is, |
I faced this kind of NPE :
I'm not sure at all, I asking myself if this doesn't come from a little bug in org.codehaus.mojo.versions.SetMojo.execute()
Should it be ?
The text was updated successfully, but these errors were encountered: