#224 support standard Gradle dependency notation in "importPom"#229
#224 support standard Gradle dependency notation in "importPom"#229bsideup wants to merge 1 commit intospring-gradle-plugins:mainfrom
Conversation
… in "importPom"
|
@bsideup Please sign the Contributor License Agreement! Click here to manually synchronize the status of this Pull Request. See the FAQ for frequently asked questions. |
|
@bsideup Thank you for signing the Contributor License Agreement! |
| PomReference reference = referencesById.get(createKey(id.getGroup(), id.getName())); | ||
| CompositePropertySource allProperties = new CompositePropertySource(reference.getProperties(), properties); | ||
| resolvedPoms.add(createPom(resolvedArtifact.getFile(), allProperties)); | ||
| for (PomReference pomReference: pomReferences) { |
There was a problem hiding this comment.
I had to change it to "1 configuration per POM", otherwise it is not possible to get the properties by resolved file.
Should be ok since there are usually only a few BOMs
| String[] components = coordinates.split(":"); | ||
| if (components.length != 3) { | ||
| throw new IllegalArgumentException("Bom coordinates must be of the form groupId:artifactId:version"); | ||
| if (dependencyNotation instanceof String || dependencyNotation instanceof GString) { |
There was a problem hiding this comment.
Unfortunately, we have to handle Strings for the backward compatibility. We could also parse strings and add @pom if not defined already, but that might cause unexpected issues for the users
|
|
||
| /** | ||
| * Imports the Maven bom with the given {@code coordinates} in the form {@code group:name:version}. | ||
| * Imports the Maven bom with the given {@code dependencyNotation}. |
There was a problem hiding this comment.
can you describe what is dependencyNotation with example or link to corresponding documentation section please?
There was a problem hiding this comment.
You mean something like "Dependency notations" from here?
https://docs.gradle.org/current/javadoc/org/gradle/api/artifacts/dsl/DependencyHandler.html
There was a problem hiding this comment.
Yes, thats it - will be enough to just link it
This solves #224 and also makes it possible to import POMs from any valid Gradle dependency notation (
group: "", artifact: "", version: "",project.files(),fromURL, etc)