Signing required doesn't work

I have the following build script fragment:

signing {
required { false }
sign configurations.archives

But gradle tries to sign the archives, even if required is set to false.

arch linux
OpenJDK Runtime Environment (build 1.8.0_92-b14)

Here is the project where it doesn’t work

To reproduce the failure just do:

–> ext.uploadToMavenCentral is false, but the signing task is executed.

I followed your instructions and the build succeeds.

What is your environment, OS / Java / gradle version?

OS X 10.11.5
Java™ SE Runtime Environment (build 1.8.0_66-b17)
Tried Gradle 2.3 (in the repo) and 2.13 (latest release)

Have you made sure that you don’t have any init scripts that tinker with signing tasks?

Ok, got it. Its the properties in the

If I have defined the following properties in

  • signing.keyId=24875D73
  • signing.password=secret
  • signing.secretKeyRingFile=/Users/me/.gnupg/secring.gpg

Then the conditional is ignored
required { false }

If the signing properties are not defined, then the conditinal will be applied.