-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PGPShowMojo - Show information about artifact signature.
- Loading branch information
1 parent
5069ba8
commit 28cd212
Showing
26 changed files
with
1,372 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
lombok.log.fieldName=LOGGER | ||
lombok.addLombokGeneratedAnnotation=true | ||
lombok.anyConstructor.addConstructorProperties=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# | ||
# Copyright 2020 Slawomir Jaranowski | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
invoker.goals = pgpverify:show -Dartifact=junit:junit:4.12 -DshowPom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
~ Copyright 2020 Slawomir Jaranowski | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>test</groupId> | ||
<artifactId>it-test-parent</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<relativePath/> | ||
</parent> | ||
|
||
<artifactId>test</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.simplify4u.plugins</groupId> | ||
<artifactId>pgpverify-maven-plugin</artifactId> | ||
<version>@project.version@</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2020 Slawomir Jaranowski | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
def buildLog = new File( basedir, 'build.log' ).text | ||
|
||
assert buildLog.contains('type: jar') | ||
assert buildLog.contains('type: pom') | ||
assert buildLog.contains('version: 4.12') | ||
|
||
assert buildLog.contains('PGP signature:') | ||
assert buildLog.contains('keyId: 0xEFE8086F9E93774E') | ||
|
||
assert buildLog.contains('PGP key:') | ||
assert buildLog.contains('fingerprint: 0xD4C89EA4AAF455FD88B22087EFE8086F9E93774E') | ||
assert buildLog.contains('master key: 0x58E79B6ABC762159DC0B1591164BD2247B936711') | ||
|
||
assert buildLog.contains('[INFO] BUILD SUCCESS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
src/main/java/org/simplify4u/plugins/PGPMojoException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* Copyright 2020 Slawomir Jaranowski | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.simplify4u.plugins; | ||
|
||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* Common runtime exception for Maven mojo. | ||
* | ||
* @author Slawomir Jaaranowski | ||
*/ | ||
public class PGPMojoException extends RuntimeException { | ||
|
||
private static class Formatter { | ||
|
||
String message; | ||
Throwable cause; | ||
|
||
public Formatter(String messageToFormat, Object[] args) { | ||
Object[] argsToFormat; | ||
Object last = args.length > 0 ? args[args.length - 1] : null; | ||
if (last instanceof Throwable) { | ||
argsToFormat = Arrays.copyOf(args, args.length - 1); | ||
cause = (Throwable) last; | ||
} else { | ||
argsToFormat = args; | ||
} | ||
message = String.format(messageToFormat, argsToFormat); | ||
} | ||
} | ||
|
||
private static final long serialVersionUID = -2691735554566086599L; | ||
|
||
public PGPMojoException() { | ||
super(); | ||
} | ||
|
||
public PGPMojoException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
public PGPMojoException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Message can contains {@link String#format(String, Object...)} placeholders. | ||
* <p> | ||
* If last argument is Throwable, then will be used as a cause of exception. | ||
* | ||
* @param message message of exception | ||
* @param args additional args for message formatting | ||
*/ | ||
public PGPMojoException(String message, Object... args) { | ||
this(new Formatter(message, args)); | ||
} | ||
|
||
private PGPMojoException(Formatter format) { | ||
super(format.message, format.cause); | ||
} | ||
} |
Oops, something went wrong.