// 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;
        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();
        if (signature != null) {
            messageBuilder.a("PGP signature:").newline();
            messageBuilder.a("\tversion:     ").strong(signature.getVersion()).newline();
            messageBuilder.a("\talgorithm:   ")
                    .strong(Try.of(() ->
                            PGPUtil.getSignatureName(signature.getKeyAlgorithm(), signature.getHashAlgorithm())).get())
                    .newline();
            messageBuilder.a("\tkeyId:       ").strong(signature.getKeyId()).newline();
            messageBuilder.a("\tcreate date: ").strong(signature.getDate()).newline();
            messageBuilder.a("\tstatus:      ");
            if (signatureCheckResult.getStatus() == SignatureStatus.SIGNATURE_VALID) {
                messageBuilder.success("valid");
            } else {
                messageBuilder.failure("invalid");
            }
            messageBuilder.newline();
        } else if (signatureCheckResult.getStatus() == SignatureStatus.SIGNATURE_NOT_RESOLVED) {
            messageBuilder.a("\t")
                    .failure("PGP signature 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;

        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();
        if (signature != null) {
            messageBuilder.a("PGP signature:").newline();
            messageBuilder.a("\tversion:     ").strong(signature.getVersion()).newline();
            messageBuilder.a("\talgorithm:   ")
                    .strong(Try.of(() ->
                            PGPUtil.getSignatureName(signature.getKeyAlgorithm(), signature.getHashAlgorithm())).get())
                    .newline();
            messageBuilder.a("\tkeyId:       ").strong(signature.getKeyId()).newline();
            messageBuilder.a("\tcreate date: ").strong(signature.getDate()).newline();
            messageBuilder.a("\tstatus:      ");
            if (signatureCheckResult.getStatus() == SignatureStatus.SIGNATURE_VALID) {
                messageBuilder.success("valid");
            } else {
                messageBuilder.failure("invalid");
            }
            messageBuilder.newline();
        } else if (signatureCheckResult.getStatus() == SignatureStatus.SIGNATURE_NOT_RESOLVED) {
            messageBuilder.a("\t")
                    .failure("PGP signature was not resolved - try mvn -U ...").newline();
        }

        messageBuilder.newline();

        KeyInfo key = signatureCheckResult.getKey();