// Path: src/main/java/org/simplify4u/plugins/pgp/ArtifactInfo.java
// @Value
// @Builder
// public class ArtifactInfo {
// 
//     @NonNull
//     String groupId;
// 
//     @NonNull
//     String artifactId;
// 
//     @NonNull
//     String type;
// 
//     @NonNull
//     String version;
// 
//     String classifier;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/KeyInfo.java
// @Builder
// @Value
// public class KeyInfo {
// 
//     @NonNull
//     KeyFingerprint fingerprint;
// 
//     KeyFingerprint master;
// 
//     Collection<String> uids;
// 
//     int version;
//     int algorithm;
// 
//     int bits;
// 
//     Date date;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureCheckResult.java
// @Value
// @Builder
// public class SignatureCheckResult {
// 
//     @NonNull
//     ArtifactInfo artifact;
// 
//     KeyInfo key;
//     /**
//      * Last address for key search.
//      */
//     String keyShowUrl;
// 
//     SignatureInfo signature;
// 
//     @NonNull
//     SignatureStatus status;
// 
//     @JsonIgnore
//     Throwable errorCause;
// 
//     public String getErrorMessage() {
//         return Optional.ofNullable(errorCause).map(Throwable::getMessage).orElse(null);
//     }
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureInfo.java
// @Value
// @Builder
// public class SignatureInfo {
// 
//     int hashAlgorithm;
//     int keyAlgorithm;
//     KeyId keyId;
//     Date date;
//     int version;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureStatus.java
// public enum SignatureStatus {
//     ARTIFACT_NOT_RESOLVED,
//     SIGNATURE_NOT_RESOLVED,
//     KEY_NOT_FOUND,
//     ERROR,
//     SIGNATURE_ERROR,
//     SIGNATURE_VALID,
//     SIGNATURE_INVALID,
//     RESOLVED
// }


import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.inject.Inject;
import io.vavr.control.Try;
import lombok.AccessLevel;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.shared.utils.logging.MessageBuilder;
import org.apache.maven.shared.utils.logging.MessageUtils;
import org.bouncycastle.openpgp.PGPUtil;
import org.simplify4u.plugins.pgp.ArtifactInfo;
import org.simplify4u.plugins.pgp.KeyInfo;
import org.simplify4u.plugins.pgp.SignatureCheckResult;
import org.simplify4u.plugins.pgp.SignatureInfo;
import org.simplify4u.plugins.pgp.SignatureStatus;
            throw new PGPMojoException("Some of artifact can't be checked");
        }
    }

    private boolean processArtifact(Map.Entry<Artifact, Artifact> artifactEntry) {

        Artifact artifactToCheck = artifactEntry.getKey();
        Artifact sig = artifactEntry.getValue();

        SignatureCheckResult signatureCheckResult = signatureUtils.checkSignature(artifactToCheck, sig, pgpKeysCache);

        MessageBuilder messageBuilder = MessageUtils.buffer();
        messageBuilder.newline();
        messageBuilder.newline();

        ArtifactInfo artifactInfo = signatureCheckResult.getArtifact();

        messageBuilder.a("Artifact:").newline();
        messageBuilder.a("\tgroupId:     ").strong(artifactInfo.getGroupId()).newline();
        messageBuilder.a("\tartifactId:  ").strong(artifactInfo.getArtifactId()).newline();
        messageBuilder.a("\ttype:        ").strong(artifactInfo.getType()).newline();
        Optional.ofNullable(artifactInfo.getClassifier()).ifPresent(
                classifier -> messageBuilder.a("\tclassifier:  ").strong(classifier).newline());
        messageBuilder.a("\tversion:     ").strong(artifactInfo.getVersion()).newline();
        if (signatureCheckResult.getStatus() == SignatureStatus.ARTIFACT_NOT_RESOLVED) {
            messageBuilder.a("\t").failure("artifact was not resolved  - try mvn -U ...").newline();
        }

        messageBuilder.newline();

// Path: src/main/java/org/simplify4u/plugins/pgp/ArtifactInfo.java
// @Value
// @Builder
// public class ArtifactInfo {
// 
//     @NonNull
//     String groupId;
// 
//     @NonNull
//     String artifactId;
// 
//     @NonNull
//     String type;
// 
//     @NonNull
//     String version;
// 
//     String classifier;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/KeyInfo.java
// @Builder
// @Value
// public class KeyInfo {
// 
//     @NonNull
//     KeyFingerprint fingerprint;
// 
//     KeyFingerprint master;
// 
//     Collection<String> uids;
// 
//     int version;
//     int algorithm;
// 
//     int bits;
// 
//     Date date;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureCheckResult.java
// @Value
// @Builder
// public class SignatureCheckResult {
// 
//     @NonNull
//     ArtifactInfo artifact;
// 
//     KeyInfo key;
//     /**
//      * Last address for key search.
//      */
//     String keyShowUrl;
// 
//     SignatureInfo signature;
// 
//     @NonNull
//     SignatureStatus status;
// 
//     @JsonIgnore
//     Throwable errorCause;
// 
//     public String getErrorMessage() {
//         return Optional.ofNullable(errorCause).map(Throwable::getMessage).orElse(null);
//     }
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureInfo.java
// @Value
// @Builder
// public class SignatureInfo {
// 
//     int hashAlgorithm;
//     int keyAlgorithm;
//     KeyId keyId;
//     Date date;
//     int version;
// }
// 
// Path: src/main/java/org/simplify4u/plugins/pgp/SignatureStatus.java
// public enum SignatureStatus {
//     ARTIFACT_NOT_RESOLVED,
//     SIGNATURE_NOT_RESOLVED,
//     KEY_NOT_FOUND,
//     ERROR,
//     SIGNATURE_ERROR,
//     SIGNATURE_VALID,
//     SIGNATURE_INVALID,
//     RESOLVED
// }


// Path: src/main/java/org/simplify4u/plugins/ShowMojo.java
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import javax.inject.Inject;
import io.vavr.control.Try;
import lombok.AccessLevel;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.shared.utils.logging.MessageBuilder;
import org.apache.maven.shared.utils.logging.MessageUtils;
import org.bouncycastle.openpgp.PGPUtil;
import org.simplify4u.plugins.pgp.ArtifactInfo;
import org.simplify4u.plugins.pgp.KeyInfo;
import org.simplify4u.plugins.pgp.SignatureCheckResult;
import org.simplify4u.plugins.pgp.SignatureInfo;
import org.simplify4u.plugins.pgp.SignatureStatus;

            throw new PGPMojoException("Some of artifact can't be checked");
        }
    }

    private boolean processArtifact(Map.Entry<Artifact, Artifact> artifactEntry) {

        Artifact artifactToCheck = artifactEntry.getKey();
        Artifact sig = artifactEntry.getValue();

        SignatureCheckResult signatureCheckResult = signatureUtils.checkSignature(artifactToCheck, sig, pgpKeysCache);

        MessageBuilder messageBuilder = MessageUtils.buffer();
        messageBuilder.newline();
        messageBuilder.newline();

        ArtifactInfo artifactInfo = signatureCheckResult.getArtifact();

        messageBuilder.a("Artifact:").newline();
        messageBuilder.a("\tgroupId:     ").strong(artifactInfo.getGroupId()).newline();
        messageBuilder.a("\tartifactId:  ").strong(artifactInfo.getArtifactId()).newline();
        messageBuilder.a("\ttype:        ").strong(artifactInfo.getType()).newline();
        Optional.ofNullable(artifactInfo.getClassifier()).ifPresent(
                classifier -> messageBuilder.a("\tclassifier:  ").strong(classifier).newline());
        messageBuilder.a("\tversion:     ").strong(artifactInfo.getVersion()).newline();
        if (signatureCheckResult.getStatus() == SignatureStatus.ARTIFACT_NOT_RESOLVED) {
            messageBuilder.a("\t").failure("artifact was not resolved  - try mvn -U ...").newline();
        }

        messageBuilder.newline();

        SignatureInfo signature = signatureCheckResult.getSignature();