Skip to content

Commit

Permalink
[JENKINS-43094] Add Maven Dependencies Fingerprint Publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyrille Le Clerc committed Jun 9, 2017
1 parent 3c9ab16 commit c4ec6ad
Showing 1 changed file with 10 additions and 4 deletions.
Expand Up @@ -78,25 +78,31 @@ public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsE

List<MavenSpyLogProcessor.MavenDependency> dependencies = listDependencies(mavenSpyLogsElt);

if (LOGGER.isLoggable(Level.FINE)) {
listener.getLogger().println("[withMaven] dependenciesFingerprintPublisher - filter: " +
"versions[snapshot: " + isIncludeSnapshotVersions() + ", release: " + isIncludeReleaseVersions() + "], " +
"scopes:" + getIncludedScopes());
}

Map<String, String> artifactsToFingerPrint = new HashMap<>(); // artifactPathInFingerprintZone -> artifactMd5
for (MavenSpyLogProcessor.MavenDependency dependency : dependencies) {
if (dependency.isSnapshot()) {
if (!includeSnapshotVersions) {
if (LOGGER.isLoggable(Level.FINE)) {
if (LOGGER.isLoggable(Level.FINER)) {
listener.getLogger().println("[withMaven] Skip fingerprinting snapshot dependency: " + dependency);
}
continue;
}
} else {
if (!includeReleaseVersions) {
if (LOGGER.isLoggable(Level.FINE)) {
if (LOGGER.isLoggable(Level.FINER)) {
listener.getLogger().println("[withMaven] Skip fingerprinting release dependency: " + dependency);
}
continue;
}
}
if (!getIncludedScopes().contains(dependency.getScope())) {
if (LOGGER.isLoggable(Level.FINE)) {
if (LOGGER.isLoggable(Level.FINER)) {
listener.getLogger().println("[withMaven] Skip fingerprinting dependency with ignored scope: " + dependency);
}
continue;
Expand Down Expand Up @@ -152,7 +158,7 @@ public void process(@Nonnull StepContext context, @Nonnull Element mavenSpyLogsE
for (Map.Entry<String, String> artifactToFingerprint : artifactsToFingerPrint.entrySet()) {
String artifactPathInFingerprintZone = artifactToFingerprint.getKey();
String artifactMd5 = artifactToFingerprint.getValue();
fingerprintMap.getOrCreate(run, artifactPathInFingerprintZone, artifactMd5);
fingerprintMap.getOrCreate(run, artifactPathInFingerprintZone, artifactMd5).addFor(run);
}

// add action
Expand Down

0 comments on commit c4ec6ad

Please sign in to comment.