I have a Java project, building with Gradle, using the Jenkins CI server, and I would like to publish to an Artifactory server, using Maven-compatible artifacts. The project is using Git. I would also like to use the release management features of Jenkins if possible.
This is very confusing. There are at least five plugins, with much overlapping redundant functionality. Some plugins seem to replace others. Some plugins seem to require others.
FYI, the five relevant plugins seem to be:
1) Jenkins Artifactory Plugin https://wiki.jenkins-ci.org/display/JENKINS/Artifactory+Plugin
2) Gradle "maven" Plugin http://www.gradle.org/docs/current/userguide/maven_plugin.html
3) Gradle "maven-publish" Plugin http://www.gradle.org/docs/current/userguide/publishing_maven.html
4) Gradle "artifactory" Plugin https://www.jfrog.com/confluence/display/RTF/Gradle+Artifactory+Plugin
5) Gradle "artifactory-publish" Plugin http://www.jfrog.com/confluence/display/RTF/Gradle+1.6+Publishing+Artifactory+Plugin
What is the best way to set this up?
If I use the Jenkins Artifactory Plugin with none of the other plugins mentioned, I get an error:
No publish configurations specified for project ':' and the default 'archives' configuration does not exist.
Cannot publish pom for project ':my-great-app' since it does not contain the Maven plugin install task and task ':my-great-app:artifactoryPublish' does not specify a custom pom path.
I assume I need to use either maven
or maven-publish
in build.gradle?
maven-publish
is labeled as the incubating successor to the maven
plugin. How much better is it? How stable is it?
How does using one of the Gradle Artifactory plugins compare to the standard maven publishing plugins vs using the Jenkins plugin?
As a Maven repository, Artifactory is both a source for artifacts needed for a build, and a target to deploy artifacts generated in the build process. Maven is configured using a settings. xml file located under your Maven home directory (typically, this will be /user.
The Gradle Artifactory Plugin allows you to deploy your build artifacts and build information to Artifactory and also to resolve your build dependencies from Artifactory. The minimum supported Gradle version is 4.10.
This is made via passing Jenkins BUILD_NUMBER variable to Maven. In the post-build actions section, add deploy artifacts to the Artifactory step, specify that you would like to add your artifacts, and check the 'Deploy Maven Artifacts' checkbox. You will also need to specify a project name and path to your repository.
artifactory
plugin works with maven
plugin and publishes configurations
, generated by maven
plugin.artifactory-publish
plugin works with maven-publish
plugin and publishes publications
generated by maven-publish
plugin.artifactory
or artifactory-publish
plugins in Gradle build script.artifactory
plugin to the Gradle script if it is not there.So, here's what you need to decide:
maven
or maven-publish
. While the later is still 'incubating', it is much more flexible than the former. Once you know with which maven plugin you want to use, select the appropriate artifactory plugin.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With