I'm using Gradle and Jenkins and want to deploy artifacts to Artifactory. Unfortunately this deployment works only once, when I start the build in Jenkins.
If I delete the workspace and the ~/.gradle Folder on the Jenkins server the deployment works again. Deleting only the workspace alone is not enough.
Seems like a bug for me. Do I have any unknown version conflicts. Or is it something different I don't see. Thanks for any help.
Environment:
- Jenkins 2.7.3
- Gradle 3.1
- Artifactory 4.13.0
- Jenkins Artifactory Plugin 2.7.2
Gradle Build Script: (Based on example from jfrog)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '4.4.5')
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
repositories {
jcenter()
}
group = 'org.jfrog.example.gradle'
version = '1.0.1-SNAPSHOT'
status = 'integration'
}
artifactory {
publish {
defaults {
publishConfigs('archives')
}
}
}
// Setting this property to true will make the artifactoryPublish task
// skip this module (in our case, the root module):
artifactoryPublish.skip = true
Jenkins Artifactory Plugin Settings:
- [x] Gradle-Artifactory-Integration
- [x] Capture and publish build info
- [x] Publish artifacts to Artifactory
- [x] Publish Maven Descriptors
- [x] Use Maven compatible Patterns
Rest is deactivated (not set).
Log in Jenkins (Console Output), on second run with changed version and changed source code:
Jenkins Artifactory Plugin version: 2.7.2
[Gradle] - Launching build.
[CdExampleArtifactory] $ cmd.exe /C '""C:\Program Files (x86)\Jenkins\tools\gradle-3.1\bin\gradle.bat"' --init-script c:/temp/init-artifactory8368571638486556211gradle artifactoryPublish && exit %%ERRORLEVEL%%"
:artifactoryPublish
:api:artifactoryPublish
:services:artifactoryPublish
:shared:artifactoryPublish
:services:webservice:artifactoryPublish
BUILD SUCCESSFUL
Total time: 2.422 secs
Build step 'Invoke Gradle script' changed build result to SUCCESS
Finished: SUCCESS
It looks like the task don't start the build (jar, etc.) process.
gradle build
in your jenkins job somewhere? – RaGe