Linkage Monitor to read artifact list file that contains Maven coordinates with versions#1962
Merged
Linkage Monitor to read artifact list file that contains Maven coordinates with versions#1962
Conversation
suztomo
commented
Feb 26, 2021
Comment on lines
-196
to
-206
| DependencyManagement dependencyManagement = model.getDependencyManagement(); | ||
| if ("pom".equals(model.getPackaging()) && dependencyManagement != null) { | ||
| // Read the content of a BOM. | ||
| for (org.apache.maven.model.Dependency dependency : | ||
| dependencyManagement.getDependencies()) { | ||
| String managedDependencyVersionlessCoordinates = | ||
| dependency.getGroupId() + ":" + dependency.getArtifactId(); | ||
| artifactToVersion.put(managedDependencyVersionlessCoordinates, dependency.getVersion()); | ||
| logger.fine("Found local artifact in the BOM: " + dependency); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This reverts #1920, which causes the problem of mixing BOMs and parent POMs.
elharo
approved these changes
Feb 26, 2021
Contributor
Author
|
Confirmed it works with gax-java (I renamed ClientSettings to ClientSettingsFoo and Linkage Monitor detected it successfully) https://gist.github.com/suztomo/79304de2a0953ffe12e8a37c4a0879bc Confirmed that this fix does not raise exception for java-asset. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1958
Another approach for the problem. Compared with #1961, this PR expects the artifact list file to have Maven coordinates with versions. In gax-java repository, Gradle's build.gradle will create such file.
What is the file will look like?
A simple Gradle task can generate this file using
$version. In gax-java's build.gradle. I'll addCC: @chingor13 who owns gax-java