17

I'm looking at the webpush-java code. I run into a problem attempting to build the project using gradle. (I'm a gradle newbie).

:signArchives FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':signArchives'.
    Cannot perform signing task ':signArchives' because it has no configured signatory

I guess that I need to configure a signatory. How do I do that?

Daniel Freeman
  • 383
  • 4
  • 11

4 Answers4

12

Quoting the Signing plugin documentation you should be able to resolve the error when you provide the expected GPG variables in the gradle.properties file in your HOME directory:

# File location: ~/.gradle/gradle.properties - see https://docs.gradle.org/current/userguide/directory_layout.html
signing.keyId=24875D73
signing.password=secret
signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg

Gradle resp. the Signing plugin will automatically pick them up in the build process.

de-jcup
  • 1,402
  • 12
  • 27
JJD
  • 50,076
  • 60
  • 203
  • 339
2

Another option that does not require a special command-line option is to add the following in your build.gradle:

signing {
    setRequired {
        // signing is only required if the artifacts are to be published
        gradle.taskGraph.allTasks.any { it.equals( PublishToMavenRepository) }
    }
    ....

See e.g. https://github.com/Vampire/command-framework/blob/master/buildSrc/src/main/kotlin/net/kautler/publishing.gradle.kts#L157

centic
  • 15,565
  • 9
  • 68
  • 125
0

I got the same problem and it was because of several things:
I didn't distribute the gpg key to any server;
I was using inMemory to sign and I shouldn't

the link of the complete answer with build.gradle file and gradle.properties file: https://stackoverflow.com/a/68505768/7937498

Itoun
  • 3,713
  • 5
  • 27
  • 47
-4

Found solution here https://github.com/jaegertracing/jaeger-client-java/issues/202 Use the below command.

./gradlew assemble -x signArchives

Harish Karthick
  • 710
  • 2
  • 12
  • 26
  • 5
    `-x signArchives` means don't execute the signing. While this solves the error, it doesn't achieve what the OP asked (how do I configure a signatory). – Pedro Loureiro Mar 28 '21 at 19:48