Skip to content

Commit 69978e6

Browse files
committed
Update GPG maven plugin dependency
This ignores .sigstore.json files by default. See: https://issues.apache.org/jira/browse/MGPG-130 Signed-off-by: Appu Goundan <[email protected]>
1 parent 73f7f9e commit 69978e6

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

sigstore-maven-plugin/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ See [GitHub documentation](https://docs.github.com/en/actions/deployment/securit
4747
4848
Notes:
4949
50-
<!-- TBD: (uncomment when gpg adding exclusion from .sigstore.java - GPG: Maven Central publication rules require GPG signing each files: to avoid GPG signing of `.sigstore.json` files, just use version 3.X.X minimum of [maven-gpg-plugin](https://maven.apache.org/plugins/maven-gpg-plugin/). -->
51-
- `.md5`/`.sha1`: to avoid unneeded checksum files for `.sigstore.java` files, use Maven 3.9.2 minimum or create `.mvn/maven.config` file containing `-Daether.checksums.omitChecksumsForExtensions=.asc,.sigstore.java`
50+
- GPG: Maven Central publication rules require GPG signing. To avoid GPG signing of `.sigstore.json` signature files, use version 3.2.5 or higher of [maven-gpg-plugin](https://maven.apache.org/plugins/maven-gpg-plugin/).
51+
- `.md5`/`.sha1`: to avoid unneeded checksum files for `.sigstore.java` files, use Maven 3.9.2 or higher, or create `.mvn/maven.config` file containing `-Daether.checksums.omitChecksumsForExtensions=.asc,.sigstore.java`
5252

5353
Known limitations:
5454

sigstore-maven-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dependencies {
1616

1717
implementation(project(":sigstore-java"))
1818
implementation("org.bouncycastle:bcutil-jdk18on:1.78.1")
19-
implementation("org.apache.maven.plugins:maven-gpg-plugin:3.2.4")
19+
implementation("org.apache.maven.plugins:maven-gpg-plugin:3.2.5")
2020

2121
testImplementation("org.apache.maven.shared:maven-verifier:1.8.0")
2222

sigstore-maven-plugin/src/main/java/dev/sigstore/plugin/SigstoreSignAttachedMojo.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,13 @@ public class SigstoreSignAttachedMojo extends AbstractMojo {
4040

4141
private static final String BUNDLE_EXTENSION = ".sigstore.json";
4242

43-
// TODO: this can potentially be derived from mvn-gpg-plugin:FilesCollector.java,
44-
// but that requires a change in that plugin before it makes sense here.
45-
private static final String DEFAULT_EXCLUDES[] =
46-
new String[] {
47-
"**/*.md5", "**/*.sha1", "**/*.sha256", "**/*.sha512", "**/*.asc", "**/*.sigstore.json"
48-
};
49-
5043
/** Skip doing the sigstore signing. */
5144
@Parameter(property = "sigstore.skip", defaultValue = "false")
5245
private boolean skip;
5346

5447
/**
5548
* A list of files to exclude from being signed. Can contain Ant-style wildcards and double
56-
* wildcards. The default excludes are <code>
57-
* **&#47;*.md5 **&#47;*.sha1 **&#47;*.sha256 **&#47;*.sha512 **&#47;*.asc **&#47;*.sigstore.json
58-
* </code>.
49+
* wildcards. The defaults are defined in DEFAULT_EXCLUDES in {@link FilesCollector}.
5950
*/
6051
@Parameter private String[] excludes;
6152

@@ -81,8 +72,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
8172
// Collect files to sign
8273
// ----------------------------------------------------------------------------
8374

84-
FilesCollector collector =
85-
new FilesCollector(project, (excludes == null) ? DEFAULT_EXCLUDES : excludes, getLog());
75+
FilesCollector collector = new FilesCollector(project, excludes, getLog());
8676
List<FilesCollector.Item> items = collector.collect();
8777

8878
// ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)