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

Error publishing build info using Gradle Artifactory plugin #476

Open
e88z4 opened this issue Apr 6, 2021 · 5 comments
Open

Error publishing build info using Gradle Artifactory plugin #476

e88z4 opened this issue Apr 6, 2021 · 5 comments
Labels
gradle bug Create a report to help us improve

Comments

@e88z4
Copy link

e88z4 commented Apr 6, 2021

Describe the bug
When publishing build information after publishing the artifact in our pipeline, we encountered the following error.

> Task :artifactoryPublish
> Task :extractModuleInfo
[pool-4-thread-1] Deploying artifact: https://artifactory.***.com/artifactory/libs-staging-local/ca/***/common/servicenow-infra-compcostenv-dc/1.0.0-d3caa64/servicenow-infra-compcostenv-dc-1.0.0-d3caa64.zip
[pool-4-thread-1] Deploying artifact: https://artifactory.***.com/artifactory/libs-staging-local/ca/***/common/servicenow-infra-compcostenv-dc/1.0.0-d3caa64/servicenow-infra-compcostenv-dc-1.0.0-d3caa64.pom
> Task :artifactoryDeploy

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 10s
15 actionable tasks: 10 executed, 5 up-to-date
ERROR: Couldn't read generated build info at : e:\disk1\jenkins\e921a184\workspace\Web\dte-containers\build_servicenow-infra-compcostenv-dc@tmp\artifactory\generated.build.info2240171544815622294.json

build.gradle publishing content

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifact source: distApp, extension: 'zip'
            version = version
        }
    }
}



artifactory {
    contextUrl = artifactory_contexturl
    publish {
        repository{
            repoKey = 'libs-snapshot-local'
        }
        defaults {
            publications('mavenJava')
        }
    }
}

To Reproduce
Declarative pipeline step executing the gradle script execution:

stage('Publish'){
                steps{
                    rtGradleRun(
                        buildFile: 'build.gradle',
                        tasks: "immutableSnapshot artifactoryPublish",
                        deployerId: "GRADLE_DEPLOYER",
                        resolverId: "GRADLE_RESOLVER",
                        useWrapper: true,
                        usesPlugin: true
                    )

                    rtPublishBuildInfo(
                        serverId: "Artifactory Prod"
                    )
                }
            }

Expected behavior
Build info is being published correctly to Artifactory.

Versions

  • Gradle Artifactory plugin version: 4.18.0, 4.21.0 (tried both versions and ended up with the same error
  • Operating system: Linux
  • Artifactory Version: 7.10.5
@e88z4 e88z4 added the gradle bug Create a report to help us improve label Apr 6, 2021
@yahavi
Copy link
Member

yahavi commented May 21, 2021

@e88z4,
Thanks for reporting this issue.
We couldn't reproduce this issue. Could you please check if the issue reproduces on the latest Gradle Artifactory plugin 4.24.0?

@raptium
Copy link

raptium commented Jun 16, 2021

Where can I get the latest release (4.24.0) of Gradle Artifactory Plugin? https://bintray.com/jfrog/jfrog-jars/build-info-extractor-gradle says the latest version is 4.21.0

@aVolpe
Copy link

aVolpe commented Jun 22, 2021

I have the same error with 4.24.5 and 4.24.0 (from maven central).

@themangoemoji
Copy link

@e88z4 Did you ever resolve this? I have the same issue. I suspect that our maven repository does not allow publishing .json files (only .pom or .jar). I do not see a way in the docs to configure the extension of the build info file.

I would also be happy to turn off build info completely with publishBuildInfo that the docs talk about
https://www.jfrog.com/confluence/display/JFROG/Gradle+Artifactory+Plugin

artifactory {
  contextUrl = 'http://repo.myorg.com/artifactory'   //The base Artifactory URL if not overridden by the publisher/resolver
  publish {
    contextUrl = 'http://repo.myorg.com/artifactory'   //The base Artifactory URL for the publisher
    //A closure defining publishing information
    repository {
      ...
      ivy {
        ....
      }
    }
    defaults {
        ...
        publishBuildInfo = false   //Publish build-info to Artifactory (true by default)
        publishArtifacts = true   //Publish artifacts to Artifactory (true by default)
        publishPom = true   //Publish generated POM files to Artifactory (true by default).
        publishIvy = true   //Publish generated Ivy descriptor files to Artifactory (true by default).
    }
}

However this doesn't seem to be supported in the Gradle Kotlin DSL. There is setPublishPom and setPublishArtifacts but no publishBuildInfo or setPublishBuildInfo.

@Mazorius
Copy link

@e88z4 & @raptium
The latest plugin version can be found here: https://plugins.gradle.org/plugin/com.jfrog.artifactory

bintray is deprecated and there you will not found any new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gradle bug Create a report to help us improve
Projects
None yet
Development

No branches or pull requests

6 participants