question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error publishing build info using Gradle Artifactory plugin

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
themangoemojicommented, Aug 31, 2021

@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.

1reaction
Mazoriuscommented, Oct 11, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gradle Artifactory Plugin - JFrog - JFrog Documentation
The Gradle Artifactory Plugin allows you to deploy your build artifacts and build information to Artifactory and also to resolve your build ......
Read more >
Artifact is not published using gradle and artifactory plugin
The code seems to work fine but actually only the build info are published. The zip is not: Deploying build descriptor to: ...
Read more >
com.jfrog.artifactory - Gradle Plugin Portal
Version 4.30.1 (latest). Created 15 December 2022. JFrog Gradle plugin for Build Info extraction and Artifactory publishing. Other versions.
Read more >
Artifactory plugin can't publish build info for Gradle builds
Most of the docs and examples I've found online that integrate Gradle, Jenkins and Artifactory assume that you are using a freestyle job ......
Read more >
Re: [Artifactory-users] Publishing Build Info via Gradle post ...
Re: [Artifactory-users] Publishing Build Info via Gradle post milestone-3 ... parentFile.mkdirs() println "Downloading the latest Artifactory plugin to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found