diff --git a/src/it/metadata-it/verify.groovy b/src/it/metadata-it/verify.groovy index a59c34d2a..9fe405d98 100644 --- a/src/it/metadata-it/verify.groovy +++ b/src/it/metadata-it/verify.groovy @@ -35,7 +35,7 @@ try (JarFile j1 = new JarFile(p1)) { assert attributes.getValue('Plugin-Version').startsWith('1.0-SNAPSHOT') assert attributes.getValue('Url').equals('https://plugins.jenkins.io/plugin1/') assert attributes.getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/maven-hpi-plugin.git') - def matcher = attributes.getValue('Plugin-GitHash') =~ pattern + def matcher = attributes.getValue('Implementation-Build') =~ pattern assert matcher.matches() } @@ -68,7 +68,7 @@ try (JarFile j2 = new JarFile(p2)) { assert attributes.getValue('Plugin-Version').startsWith('1.0-SNAPSHOT') assert attributes.getValue('Url').equals('https://plugins.jenkins.io/multimodule-it-plugin2/') assert attributes.getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/maven-hpi-plugin.git') - def matcher = attributes.getValue('Plugin-GitHash') =~ pattern + def matcher = attributes.getValue('Implementation-Build') =~ pattern assert matcher.matches() } diff --git a/src/it/verify-it/verify.groovy b/src/it/verify-it/verify.groovy index 7c9cf0d04..9ce357ed2 100644 --- a/src/it/verify-it/verify.groovy +++ b/src/it/verify-it/verify.groovy @@ -56,7 +56,7 @@ Files.newInputStream(new File(basedir, 'target/verify-it/META-INF/MANIFEST.MF'). assert manifest.getMainAttributes().getValue('Plugin-ScmConnection').equals('scm:git:https://github.com/jenkinsci/verify-it-plugin.git') assert manifest.getMainAttributes().getValue('Plugin-ScmTag').equals('HEAD') assert manifest.getMainAttributes().getValue('Plugin-ScmUrl').equals('https://github.com/jenkinsci/verify-it-plugin') - def matcher = manifest.getMainAttributes().getValue('Plugin-GitHash') =~ pattern + def matcher = manifest.getMainAttributes().getValue('Implementation-Build') =~ pattern assert matcher.matches() assert manifest.getMainAttributes().getValue('Plugin-Version').startsWith('1.0-SNAPSHOT') assert manifest.getMainAttributes().getValue('Short-Name').equals('verify-it') diff --git a/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJenkinsManifestMojo.java b/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJenkinsManifestMojo.java index f9575a982..690e88a67 100644 --- a/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJenkinsManifestMojo.java +++ b/src/main/java/org/jenkinsci/maven/plugins/hpi/AbstractJenkinsManifestMojo.java @@ -254,10 +254,7 @@ protected void setAttributes(Manifest.ExistingSection mainSection) mainSection, "Plugin-ScmConnection", project.getScm().getConnection()); addAttributeIfNotNull(mainSection, "Plugin-ScmTag", project.getScm().getTag()); addAttributeIfNotNull(mainSection, "Plugin-ScmUrl", project.getScm().getUrl()); - String gitHash = getGitHeadSha1(); - // Deprecated: Use "Implementation-Build" for consistency with core and core components - addAttributeIfNotNull(mainSection, "Plugin-GitHash", gitHash); - addAttributeIfNotNull(mainSection, "Implementation-Build", gitHash); + addAttributeIfNotNull(mainSection, "Implementation-Build", getGitHeadSha1()); } /**