-
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
NPE upon versionless dependencies in dependencyManagement #442
Comments
What is your expectation here? Specifying dependencies without a version is a bug. Maven is all about fixating versions of dependencies and plugins to stabilize the build. I agree that the plugin could behave a little better :-) |
The idea is that instead of blow up, it should try to help to indicate what's the problem or where it comes. Such as to report the dependencies for which the versions are missing, or even better with line numbers, etc. |
I would agree to throw a <project>
<modelVersion>4.0.0</modelVersion>
<artifactId>foo</artifactId>
<groupId>bar</groupId>
<version>1.0</version>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
</project> When running |
Thank you @mfriedenhagen. Even though |
|
BTW, in the original case, the unversioned junit only appears in the dependencyManagement section, and not in dependencies. |
I know, it seems |
* `mvn` validate does choke on dependencies without versions. * However in managed dependencies a missing version is ignored. * resolve-ranges does throw a NPE, which is not helpful. * So fail with available coordinates to make fixing easier. * When the artifactId is missing in a managed dependency Maven core will aready fail. Resolve #442
* `mvn validate` does choke on dependencies without versions. * However in managed dependencies a missing version is ignored. * resolve-ranges does throw a NPE, which is not helpful. * So fail with available coordinates to make fixing easier. * When the artifactId is missing in a managed dependency Maven core will aready fail. Resolve #442
* `mvn validate` does choke on dependencies without versions. * However in managed dependencies a missing version is ignored. * resolve-ranges does throw a NPE, which is not helpful. * So fail with available coordinates to make fixing easier. * When the artifactId is missing in a managed dependency Maven core will aready fail. Resolve mojohaus#442
When running
mvn versions:resolve-ranges
with versions plugin 2.8.1, it fails with NullPointerException, which seems to be related to dependencies without versions, such asjunit:junit:jar
In one of our parent pom, we use org.eclipse.m2e:lifecycle-mapping in a way similar to what described here: https://stackoverflow.com/a/7423909/537554The text was updated successfully, but these errors were encountered: