Skip to content

Task ':lib:generateMetadataFileForMavenPublication' uses this output of task ':lib:plainJavadocJar' without declaring an explicit or implicit dependency. #772

Description

@drernie

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions