Skip to content

Commit 8aa9dc1

Browse files
committed
add optional wait time before signing a file
1 parent c290e80 commit 8aa9dc1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/apache/maven/plugins/gpg/SigstoreSignAttachedMojo.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ public class SigstoreSignAttachedMojo
7575
@Parameter( defaultValue = "${project}", readonly = true, required = true )
7676
protected MavenProject project;
7777

78+
/**
79+
* PoC: wait time before each file signature (in seconds)
80+
*/
81+
@Parameter( property = "sigstore.wait", defaultValue = "0" )
82+
private long wait;
83+
7884
/**
7985
* Maven ProjectHelper
8086
*/
@@ -181,6 +187,12 @@ else if ( project.getAttachedArtifacts().isEmpty() )
181187
KeylessSigner signer = KeylessSigner.builder().sigstoreStagingDefaults().build();
182188
for ( SigningBundle bundleToSign : filesToSign )
183189
{
190+
if ( wait > 0 )
191+
{
192+
getLog().info( "waiting for " + wait + " seconds before signing" );
193+
Thread.sleep( wait * 1000 );
194+
}
195+
184196
File fileToSign = bundleToSign.getSignature(); // reusing original GPG implementation where it's the signature: TODO change
185197

186198
KeylessSignature signature = signer.signFile( fileToSign.toPath() );

0 commit comments

Comments
 (0)