Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(resolve-ranges): fail properly on managed dep without version
* `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
- Loading branch information
1 parent
cee63d8
commit c88c6cf
Showing
4 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals=-X ${project.groupId}:${project.artifactId}:${project.version}:resolve-ranges | ||
invoker.buildResult=failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<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>it-resolve-ranges-issues-442</artifactId> | ||
<version>1.0</version> | ||
<packaging>pom</packaging> | ||
<name>resolve-ranges IT issue 442</name> | ||
|
||
<description>Test that resolve-range chokes (correctly) on missing version in dependencyManagement</description> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def buildLogFile = new File(basedir, "build.log") | ||
assert buildLogFile.text.contains("MojoExecutionException: Found invalid managed dependency junit:junit:jar without a version") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters