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.

Env:
arch linux
OpenJDK Runtime Environment (build 1.8.0_92-b14)
gradle-2.13

Here is the project where it doesn’t work https://github.com/swisspush/vertx-rest-storage.

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 gradle.properties.

If I have defined the following properties in gradle.properties:

  • 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.