Open antonalechnovic opened 5 years ago
Additionally the sample project doesn't even run: https://github.com/jfrog/project-examples/tree/master/gradle-examples/gradle-example-ci-server this is mess
I'm not sure if it's related but on my multi-project build I get
No artifacts for deployment were found
I managed to resolve this - the documentation isnt clear. The bit that I was missing was the publishing
block in each of my subprojects. As soon as I added that, everything worked.
@willis7 can you paste the solution
@MarsPlanet not sure if you figured it out in the end but here is my solution;
apply plugin: "java"
apply plugin: "com.jfrog.artifactory"
apply plugin: "maven"
...
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = rootProject.name
// you may have to assign version here
}
}
}
Then add the publication to the default publish:
artifactory {
publish {
...
defaults {
publications("mavenJava")
...
}
}
}
You can make the artifactoryPublish task depend on the build and the tell the default publish to publish the configs:
apply plugin: "java"
apply plugin: "com.jfrog.artifactory"
apply plugin: "maven-publish"
...
artifactoryPublish {
dependsOn build
}
artifactory {
publish {
...
defaults {
publishConfigs("archives", "published") // I'm not actually sure what config's to put here, but these work for me 😅
...
}
}
}
Also I found sometimes doing a 'clean build artifactoryPublish' works, when 'build artifactoryPublish' does not.
Considering minimalist build.gradle:
Using tutorial: https://www.jfrog.com/confluence/display/RTF/Gradle+Builds
with Gradle wrapper 5.5.1
And Jenkins version: 2.107.3
And Jenkins Artifactory Plugin version: 3.2.1
On running the job as in the link:
This does not publish anything but the build descriptor
Everything works fine when trying to publish locally to artifactory but that needs