-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle Maven parent relative path (#1149)
When Maven looks for the parent POM, it first looks up the specified relative path, then look for the default relative path which is `../pom.xml`, and lastly in the remote repository. If only a directory is specified in relative path, `pom.xml` will be looked automatically. Reference: https://maven.apache.org/ref/3.9.8/maven-model/maven.html#parent Currently, OSV-Scanner only do some steps above, this PR corrects this. Also, considering both `internal/manifest` and `internal/resolution/manifest` require basically the same logic for merging parent POM, I would like to refactor this in a following PR.
- Loading branch information
Showing
11 changed files
with
150 additions
and
26 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
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
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
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
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
internal/resolution/manifest/fixtures/maven/parent/grandparent/mismatch.xml
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,11 @@ | ||
<project> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.upstream</groupId> | ||
<artifactId>wrong-parent</artifactId> | ||
<version>1.1.1</version> | ||
|
||
<packaging>pom</packaging> | ||
|
||
</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
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
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,10 @@ | ||
<!-- For testing parent relative path --> | ||
<project> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>org.test</groupId> | ||
<artifactId>test</artifactId> | ||
<version>1.0.0</version> | ||
|
||
</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
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