Put Maven plugins in Artifactory repository - maven-3

I would like to set up a Maven repository with Artifactory.
What are the steps to setup Maven plugins repo in Artifactory. I have to load Maven Jacoco plugin from Artifactory local repo.

Seems your use case can be achieved with general instructions of Maven Repository of Artifactory. Since, you would like to deploy maven type package/plugins, there would no difference in the setup.
We should be able resolve the deployed packages/plugins from maven clients without any issues. Is there anything difference in the use case?

Related

How to import a jar file from jfrog artifactory into Jenkins .m2 repository?

I have a Jfrog Artifactory installation which has some artifacts. I want to pull these artifacts onto my Jenkins .m2 repository. I don't have much knowledge of Jenkins.
As long as you have properly configured you maven remote repository settings, maven will resolve the artifacts and place them in the local repo during the build process.
Alternatively, (not recommended), you can use curl or wget and mvn install:install-file -Dfile=<path-to-file> ... , but that is rather pointless and more work than letting maven do what maven does.
Cloudbees has recommendations for settings if you don't want them in you repo's settings.xml; S/O answer has some advice, as does the pipeline-maven plugin and the Jenkins Docs.

How to checkout Artifactory repo in jenkins workspace

I am new to artifactory just wanted to know if there is a way to checkout artifactory repo similar to git repository so that the content of the artifactory repo is visible in the Jenkins workspace.
For git repo we get options like checkout as a subfolder I want to know if we can do something similar to that for artifactory in Jenkins
Any suggestions
Git is the VCS and Artifactory is a repository manager and I doubt that this cannot be done. Artifactory in Jenkins is used for retrieving/downloading the packages, resolving the dependencies and deploying the build to Artifactory. If my understanding in incorrect, kindly elaborate on the use-case for better. Refer to the below wikis for better understanding,
https://www.jfrog.com/confluence/display/JFROG/Jenkins+Artifactory+Plug-in
https://www.jfrog.com/confluence/display/JFROG/Declarative+Pipeline+Syntax
https://www.jfrog.com/confluence/display/JFROG/Scripted+Pipeline+Syntax
https://github.com/jfrog/project-examples/tree/master/jenkins-examples/pipeline-examples/declarative-examples

How to promote non maven artifacts in Nexus?

I have a non maven project whose binaries get deployed to Nexus.
I used gradle's maven plugin to create the artifacts and publish it to Nexus
Now, the trouble is how do I promote this artifacts to release in Nexus? I tried looking up the M2 release plugin for jenkins but it looks for the pom file in my source code.
There are a number of Gradle examples including usage with the Nexus staging suite in the Nexus book examples and eval guide.

Gradle + Jenkins + Artifactory Maven Repo?

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?
Gradle Artifactory plugins: Gradle can deploy build artifacts and build information directly, without need in CI server by using one of the Artifactory plugins.
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.
Jenkins Artifactory plugin works in two modes:
Providing a UI to override settings, specified in artifactory or artifactory-publish plugins in Gradle build script.
Adding and configuring artifactory plugin to the Gradle script if it is not there.
It also provides release management (for both modes).
So, here's what you need to decide:
Whether you use one of the Gradle plugins. Our recommendation is - use it (versioned configuration in build script is an advantage comparing to UI-only configuration.
Which plugin you want to use -- 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.
You need the Artifactory Jenkins plugin in either way if you want to use the release functionality, just check (or uncheck) the 'Project uses the Artifactory Gradle Plugin' checkbox.

Publish to Artifactory copied from another project artifacts in Jenkins

So I got few separated jobs in Jenkins. The first one gets the project from a Git repository, builds it and produces artifacts. And another one has to copy certificates from the first job and publish them to Artifactory (tried to make it using the Artifactory plugin). But the thing is that the Artifactory plugin's available only in the Build job, there's nothing like "Generic-Artifactory integration" in second job's configuration.
Does anyone know what are the requirements for making the plugin work in the Publish job?
You can write a small shell script leveraging Artifactory REST API and execute it in your second, non-build job.
I have done a similar thing with maven and a zip file. I have deployed a zip with a build step in maven calling a deploy:deploy-file and setting my Artifactory repository in settings.xml and deploying directly on my artifactory repository.

Resources