Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reason: Task ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' uses this output of task ':gradle-license-plugin:dokkaJavadocJar' without declaring an explicit or implicit dependency. #536

Closed
jaredsburrows opened this issue Mar 14, 2023 · 3 comments · Fixed by #543

Comments

@jaredsburrows
Copy link
Contributor

When trying to update gradle-license-plugin, I am seeing the following error.

Reason: Task ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' uses this output of task ':gradle-license-plugin:dokkaJavadocJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.

Versions used:

libs.versions.toml

maven-publish = { id = "com.vanniktech.maven.publish", version = "0.24.0" }
plugin-publish = { id = "com.gradle.plugin-publish", version = "1.1.0" } # works with `0.21.0`

gradle.properties

SONATYPE_HOST=DEFAULT
SONATYPE_AUTOMATIC_RELEASE=true
RELEASE_SIGNING_ENABLED=true

GROUP=com.jaredsburrows
VERSION_NAME=0.9.1-SNAPSHOT

POM_INCEPTION_YEAR=2016
POM_PACKAGING=jar
POM_URL=https://github.com/jaredsburrows/gradle-license-plugin

POM_ISSUE_SYSTEM=github
POM_ISSUE_URL=https://github.com/jaredsburrows/gradle-license-plugin/issues

POM_SCM_URL=https://github.com/jaredsburrows/gradle-license-plugin
POM_SCM_CONNECTION=scm:git:git://github.com/jaredsburrows/gradle-license-plugin.git
POM_SCM_DEV_CONNECTION=scm:git:ssh://git@github.com/jaredsburrows/gradle-license-plugin.git

POM_LICENSE_NAME=The Apache Software License, Version 2.0
POM_LICENSE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENSE_DIST=repo

POM_DEVELOPER_ID=jaredsburrows
POM_DEVELOPER_NAME=Jared Burrows
POM_DEVELOPER_EMAIL=jaredsburrows@gmail.com

PLUGIN_NAME=com.jaredsburrows.license
PLUGIN_NAME_CLASS=com.jaredsburrows.license.LicensePlugin

Repro:

gradlew -i publish

Full Error:

> Task :gradle-license-plugin:generateMetadataFileForPluginMavenPublication FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' (type 'GenerateModuleMetadata').
  - Gradle detected a problem with the following location: '/Users/<>/repo/gradle-license-plugin/gradle-license-plugin/build/libs/gradle-license-plugin-javadoc.jar'.
    
    Reason: Task ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' uses this output of task ':gradle-license-plugin:dokkaJavadocJar' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':gradle-license-plugin:dokkaJavadocJar' as an input of ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication'.
      2. Declare an explicit dependency on ':gradle-license-plugin:dokkaJavadocJar' from ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' using Task#dependsOn.
      3. Declare an explicit dependency on ':gradle-license-plugin:dokkaJavadocJar' from ':gradle-license-plugin:generateMetadataFileForPluginMavenPublication' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.0.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
15 actionable tasks: 12 executed, 2 from cache, 1 up-to-date
Watched directory hierarchies: [/Users/<>/repo/gradle-license-plugin]

Publishing build scan...
https://gradle.com/s/ugtx3alhw4yma
@gabrielittner
Copy link
Collaborator

I need to take a closer look but this is probably an issue in either Gradle or com.gradle.plugin-publish. We are creating dokkaJavadocJar in this plugin but we are then just passing it to MavenPublication.artifact and let Gradle take care of the rest. So Gradle should be registering the task dependency from any publishing task that it creates to dokkaJavadocJar.

I'll try to take a closer look in the next days.

@gabrielittner
Copy link
Collaborator

#542 let me to the right direction and I've got a fix for this issue. There should be a new release very soon. One workaround until then would be to use the base plugin and skip making the configure(...) call in our extension.

Thanks for the report

@jaredsburrows
Copy link
Contributor Author

@gabrielittner Thanks for fast response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants