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?
It means that dependency graph contains multiple dependencies with the same group and module but different versions for e.g. org.
dependsOn(jar) means that if you run assemble , then the jar task must be executed before. the task transitive dependencies, in which case we're not talking about tasks, but "publications". For example, when you need to compile project A , you need on classpath project B , which implies running some tasks of B .
Configuration inheritance and composition For example the testImplementation configuration extends the implementation configuration. The configuration hierarchy has a practical purpose: compiling tests requires the dependencies of the source code under test on top of the dependencies needed write the test class.
Locating tasks In general, tasks are available through the tasks collection. You should use of the methods that return a task provider – register() or named() – to make sure you do not break task configuration avoidance. Tasks of a specific type can also be accessed by using the tasks. withType() method.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With