jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
147 stars 155 forks source link

Error: MissingMethodException: No signature of method applying "com.jfrog.artifactory" #713

Open jtullgrenMedallia opened 1 year ago

jtullgrenMedallia commented 1 year ago

Describe the bug An error occurs when applying the gradle artifactory plugin to a precompiled script plugin:

Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@7f065b2c' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'```

Cause 1: groovy.lang.MissingMethodException: No signature of method: org.jfrog.gradle.plugin.artifactory.extractor.listener.ProjectsEvaluatedBuildListener$_afterEvaluate_closure1.doCall() is applicable for argument types: (org.jfrog.gradle.plugin.artifactory.task.ArtifactoryTask_Decorated) values: [task ':brand-sdk-project:brand-api-internal:artifactoryPublish']

To Reproduce

  1. Create a gradle composite build of two java/kotlin projects, A and B, and a parent.
  2. Include build A in build B - Ensure projects compile fine
  3. Add org.jfrog.buildinfo:build-info-extractor-gradle:4.31.4 as an implementation dependency in build A build.gradle.kts.
  4. Add the kotlin dsl as a plugin in build A build.gradle.kts
    plugins {
    `kotlin-dsl`
    }
  5. Add a kotlin precompiled script plugin file in which to add the jfrog plugin in build A: src/main/kotlin/example/example-convention.gradle.kts
    // the contents of example-convention.gradle.kts
    plugins {
    id("com.jfrog.artifactory")
    id("maven-publish")
    }
  6. Check that both projects compile

Expected behavior There should be no Error.

Screenshots None as it is a build error.

Versions

Additional context This is working for numerous other plugins, such as detekt, kotest, kotlin plugins, android, and built in gradle plugins.