Task ':lib:generateMetadataFileForMavenPublication' uses this output of task ':lib:plainJavadocJar' without declaring an explicit or implicit dependency.
drernie opened this issue · 2 comments
Apologies if I am doing something silly...
I am trying to use the plugin to publish to SonatypeHost.CENTRAL_PORTAL
.
I followed the instructions to setup my build.gradle (in this PR).
To use it, I'm assuming I just need to do ./gradlew publish
. But I get the following error:
> Task :lib:generateMetadataFileForMavenPublication
> Task :lib:generatePomFileForMavenPublication
> Task :lib:plainJavadocJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':lib:plainJavadocJar' (type 'JavadocJar').
- Gradle detected a problem with the following location: '/Users/ernest/GitHub/quiltcore-java/lib/build/libs/lib-javadoc.jar'.
Reason: Task ':lib:generateMetadataFileForMavenPublication' uses this output of task ':lib:plainJavadocJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
The strange part is that when I try following a suggestion:
2. Declare an explicit dependency on ':lib:plainJavadocJar' from ':lib:generateMetadataFileForMavenPublication' using Task#dependsOn.
And add the following line to the end of my src/build.gradle
:
tasks.named("generateMetadataFileForMavenPublication").configure { dependsOn("plainJavadocJar") }
I instead get the error:
* What went wrong:
A problem occurred evaluating project ':lib'.
> Task with name 'generateMetadataFileForMavenPublication' not found in project ':lib'.
Any idea what I might be doing wrong?
Could you try removing these 2 lines https://github.com/quiltdata/quiltcore-java/blob/fdecdc7ffa7226f1851caa36c6f53499341b1bde/lib/build.gradle#L40-L41? The publishing plugin does set these up automatically and I think something might be conflicting there.
That seems to have unblocked it! On to the next error :-0 Thanks.