jfrog / artifactory-gradle-plugin

JFrog Gradle plugin for Build Info extraction and Artifactory publishing.
Apache License 2.0
21 stars 15 forks source link

build-info-extractor-gradle version 5.1.4 fails with "compileSdkVersion is not specified" #64

Closed jonheideman closed 11 months ago

jonheideman commented 1 year ago

Describe the bug

build.gradle configured with classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" fails when pulling latest JFrog Gradle plugin version 5.1.4.

Current behavior

Downloading /artifactory/ext-maven-remote/org/jfrog/buildinfo/build-info-extractor-gradle/5.1.4/build-info-extractor-gradle-5.1.4.jar to /home/gitlab-runner/.gradle/.tmp/gradle_download10827744017953461929bin Compiling build file '/home/gitlab-runner/builds/saYMexgh/0/exercise/build.gradle' using BuildScriptTransformer.

Configure project :app Compiling build file '/home/gitlab-runner/builds/saYMexgh/0/exercise/app/build.gradle' using BuildScriptTransformer. FAILURE: Build completed with 2 failures. 1: Task failed with an exception.

  • Where: Build file '/home/gitlab-runner/builds/saYMexgh/0/exercise/app/build.gradle' line: 5
  • What went wrong: A problem occurred evaluating project ':app'. Failed to apply plugin class 'org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin'. Cannot run Project.afterEvaluate(Action) when the project is already evaluated.
  • Try: Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

    2: Task failed with an exception.

  • What went wrong: A problem occurred configuring project ':app'. compileSdkVersion is not specified. Please add it to build.gradle

Reproduction steps

  1. Configure build.gradle to use JFrog plugin version 5.1.2. For example: classpath "org.jfrog.buildinfo:build-info-extractor-gradle:5.1.2"
  2. Build will resolve the dependency and compile as expected.
  3. Configure build.gradle to use JFrog plugin version 5.1.4. For example: classpath "org.jfrog.buildinfo:build-info-extractor-gradle:5.1.4"
  4. Build now fails with "compileSdkVersion is not specified. Please add it to build.gradle"

Note that we are specifying compileSdkVersion in the same buidl.gradle file that specifies the Jfrog plugin....

android { compileSdkVersion 33 .... }

Expected behavior

No response

Artifactory Gradle plugin version

6.1.4

Operating system type and version

Ubuntu

JFrog Artifactory version

7.46.10

Gradle version

7.4.1

nickplucker commented 1 year ago

Seeing this as well with 5.1.4. Downgrading to 5.1.2 as @jonheideman mentioned is working.

yahavi commented 1 year ago

@nickplucker @jonheideman Thanks for reporting this issue. Could you please run the Gradle command with --stacktrace and share the stacktrace?

jonheideman commented 1 year ago

You bet. See attached with --stacktrace. build_with_stacktrace.txt

yahavi commented 1 year ago

Thanks @nickplucker @jonheideman, We attempted to replicate it without any success up to this point. Could you possibly supply a minimal reproducer?

jonheideman commented 1 year ago

@yahavi - Unfortunately I don't have a "minimal reproducer" publicly available to share. I can tell you that the issue started with the changes in 5.1.3. We've pinned and are running with 5.1.2 for now.

yahavi commented 11 months ago

@nickplucker @jonheideman Sorry for the inconvenience caused by this issue. We've initiated the process of addressing it by setting up https://github.com/jfrog/artifactory-gradle-plugin/pull/70. We'll make sure to provide you with updates as we make progress.

yahavi commented 11 months ago

@nickplucker @jonheideman Gradle Artifactory plugin version 5.1.9 has been released. This update incorporates a fix for a particular issue. We would be grateful for any feedback you might have on it.

jonheideman commented 11 months ago

@yahavi - I reconfigured my build.gradle classpath with "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" It pulled in build-info-extractor-gradle/5.1.9/build-info-extractor-gradle-5.1.9.jar The build completes successfully. Thanks for the fix!