-
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
Resolves #973: NPE if actual version is null for a dependency #974
Resolves #973: NPE if actual version is null for a dependency #974
Conversation
f8e0c0c
to
a27af46
Compare
ad63336
to
56106e8
Compare
56106e8
to
38cf2ac
Compare
versions-maven-plugin/src/it/it-display-dependency-updates-issue-973-versionless/pom.xml
Show resolved
Hide resolved
@slawekjaranowski The plugin itself must define a dependency version in its dependencies or dependency management. This does trigger the error and will be helped with the patch. For this to work though as an it, the plugin needs to be executed. <pluginManagement>
<plugins>
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>4.7.3.4</version>
<dependencies>
<!-- overwrite dependency on spotbugs if you want to
specify the version of spotbugs -->
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement> In this case, it does define the dependency on EDIT: No, it will still fail if we actually try executing the plugin |
@slawekjaranowski Ok, so I guess this is another edge case: the pom.xml will fail when we try executing the actual plugin as it is invalid -- lacks version. However, this faulty pom.xml will cause an NPE on the versions plugin if we try bumping the versions. So, maybe let's allow this faulty pom.xml as the goal here is not to execute the plugin, but to make the versions plugin not fail while processing the pom. |
Sounds reasonable - we only need comments on IT tah such configurations is not working |
10a0608
to
38cf2ac
Compare
Dropped my test commit 😄 |
Added a description. Did not squash :) |
In case a dependency version is specified in dependencyManagement, a dependency can be versionless.
Dependency updates goals would then attempt to find an updated version to a versionless dependency, which would fail with an NPE or, if that is prevented, an attempt would have been made to find an update to version specified as [,0], which would be any version.
Preventing both issues.
@slawekjaranowski please review.