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

jf audit gradle and Artifactory plugin resolution since 2.36.1 #1995

Open
gregoryboue opened this issue May 24, 2023 · 0 comments
Open

jf audit gradle and Artifactory plugin resolution since 2.36.1 #1995

gregoryboue opened this issue May 24, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@gregoryboue
Copy link

gregoryboue commented May 24, 2023

Describe the bug

After 2.36.1 jf cli version and this PR : jfrog/jfrog-cli-core#719 , the jf audit command fail on gradle project with error :
Could not get unknown property 'artifactoryPublish' for project '...' of type org.gradle.api.Project.

The root cause seems to be that the init.gradle plugin generated and used in the following command do not contains anymore gradle artifactory plugin apply :

Running gradle deps tree command: ./gradlew clean generateDepTrees -I /tmp/jfrog.cli.temp.-1684849391-4160074373/gradledeptree.init -q -Dcom.jfrog.depsTreeOutputFile=/tmp/jfrog.cli.temp.-1684849391-4160074373/gradledeptree.out -Dcom.jfrog.includeAllBuildFiles=true

Current behavior

jf audit --watches ... --gradle

Task failed with an exception.
-----------
* Where:
Script '.../app.build.gradle' line: 43

* What went wrong:
A problem occurred evaluating script.
> Could not get unknown property 'artifactoryPublish' for project ':app' of type org.gradle.api.Project.

Reproduction steps

Have a simple gradle project (android for the example) with artifactoryPublish configuration like following :

    artifactoryPublish.dependsOn('build')
    artifactoryPublish {
        publications(publishing.publications.app)
    }

The important thing is to not configure gradle artifactory plugin in buildscript dependencies and not apply com.jfrog.artifactory

Then run the command jf audit --gradle

The error described above is raised since 2.36.1

Expected behavior

The expected behaviour is to have a functional jf audit command as before 2.36.1

Applying jfrog plugin in build.gradle is not a solution because, when I run jf gradle-config followed by jf gradle.. I raise the following error :

Failed to apply plugin class 'org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin'.
> Cannot cast object 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention@1c6cddbd' with class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention' to class 'org.jfrog.gradle.plugin.artifactory.dsl.ArtifactoryPluginConvention'

Because the plugin is applied by the init.gradle file generated by jfrog CLI plugin.

JFrog CLI version

2.36.1 to 2.38.2

Operating system type and version

Ubuntu

JFrog Artifactory version

7.55.10

JFrog Xray version

3.71.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant