#64 - Improved logging for managed dependency upgrades.
This commit is contained in:
@@ -135,10 +135,22 @@ class MavenBuildSystem implements BuildSystem {
|
|||||||
|
|
||||||
logger.log(BUILD, "%s", module);
|
logger.log(BUILD, "%s", module);
|
||||||
|
|
||||||
pom.setDependencyManagementVersion(new MavenArtifact(module).getArtifactId(), version);
|
String moduleArtifactId = new MavenArtifact(module).getArtifactId();
|
||||||
|
pom.setDependencyManagementVersion(moduleArtifactId, version);
|
||||||
|
logger.log(BUILD, "Updated managed dependency version for %s to %s!", moduleArtifactId, version);
|
||||||
|
|
||||||
module.getProject().doWithAdditionalArtifacts(
|
module.getProject().doWithAdditionalArtifacts(additionalArtifact -> {
|
||||||
additionalArtifact -> pom.setDependencyManagementVersion(additionalArtifact.getArtifactId(), version));
|
|
||||||
|
String artifactId = additionalArtifact.getArtifactId();
|
||||||
|
Artifact artifact = pom.getManagedDependency(artifactId);
|
||||||
|
|
||||||
|
if (artifact != null) {
|
||||||
|
pom.setDependencyManagementVersion(artifactId, version);
|
||||||
|
logger.log(BUILD, "Updated managed dependency version for %s to %s!", artifactId, version);
|
||||||
|
} else {
|
||||||
|
logger.log(BUILD, "Artifact %s not found, skipping update!", artifactId);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateInformation.getPhase().equals(Phase.PREPARE)) {
|
if (updateInformation.getPhase().equals(Phase.PREPARE)) {
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ public interface Pom {
|
|||||||
@XBWrite("/project/dependencyManagement/dependencies/dependency[artifactId=\"{0}\"]/version")
|
@XBWrite("/project/dependencyManagement/dependencies/dependency[artifactId=\"{0}\"]/version")
|
||||||
Pom setDependencyManagementVersion(String artifactId, @XBValue ArtifactVersion version);
|
Pom setDependencyManagementVersion(String artifactId, @XBValue ArtifactVersion version);
|
||||||
|
|
||||||
|
@XBRead("/project/dependencyManagement/dependencies/dependency[artifactId=\"{0}\"]")
|
||||||
|
Artifact getManagedDependency(String artifactId);
|
||||||
|
|
||||||
@XBRead("//dependency[substring(version, string-length(version) - string-length('-SNAPSHOT') + 1) = '-SNAPSHOT']")
|
@XBRead("//dependency[substring(version, string-length(version) - string-length('-SNAPSHOT') + 1) = '-SNAPSHOT']")
|
||||||
List<Artifact> getSnapshotDependencies();
|
List<Artifact> getSnapshotDependencies();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user