Skip to content

Commit

Permalink
Fix #808 - Maven-Site choose wrong PGP key
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
  • Loading branch information
laeubi committed Mar 30, 2022
1 parent b1b992c commit 62102ca
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -255,7 +256,12 @@ public void execute() throws MojoExecutionException, MojoFailureException {
if (includePGPSignature) {
for (Artifact attached : mavenProject.getAttachedArtifacts()) {
if (attached.getType().equals(attachedSignature)) {
attachedSignatureFile = attached.getFile();
//check that this is the "main" artifact signature
if (Objects.equals(attached.getArtifactId(), artifact.getArtifactId())
&& Objects.equals(attached.getGroupId(), artifact.getGroupId())
&& (attached.getClassifier() == null || attached.getClassifier().isEmpty())) {
attachedSignatureFile = attached.getFile();
}
}
}
}
Expand Down Expand Up @@ -481,8 +487,7 @@ protected File createMavenAdvice(Artifact artifact) throws MojoExecutionExceptio
p2.deleteOnExit();
Properties properties = new Properties();
addProvidesAndProperty(properties, TychoConstants.PROP_GROUP_ID, artifact.getGroupId(), cnt++);
addProvidesAndProperty(properties, TychoConstants.PROP_ARTIFACT_ID, artifact.getArtifactId(),
cnt++);
addProvidesAndProperty(properties, TychoConstants.PROP_ARTIFACT_ID, artifact.getArtifactId(), cnt++);
addProvidesAndProperty(properties, TychoConstants.PROP_VERSION, artifact.getVersion(), cnt++);
addProvidesAndProperty(properties, TychoConstants.PROP_EXTENSION, artifact.getType(), cnt++);
addProvidesAndProperty(properties, TychoConstants.PROP_CLASSIFIER, artifact.getClassifier(), cnt++);
Expand Down

0 comments on commit 62102ca

Please sign in to comment.