build-info
build-info copied to clipboard
Error publishing build info using Gradle Artifactory plugin
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, 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?
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
I have the same error with 4.24.5
and 4.24.0
(from maven central).
@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
.
@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.