jenkins integration with artifactory 5.5.2 - jenkins

Currently I am using JFrog OSS version 5.5.2 for my artifacts which is integrated with Jenkins version 2.19.4. The artifactory plugin version is 2.13.1. I created a free-style software project. The repository type is “generic-local”. I am able to run build successfully and builds are saved in repository but the artifacts are not saved.Also, there is no option called “deploy artifacts to artifactory” in Jenkins configuration.
Do I have change my settings or update Jenkins?
Please advice me what changes has to be done.

Do I need to upgrade jenkins?
No: the Artifactory plugin requires a Jenkins Core 1.521.
But you would need to define a Maven 2/3 build instead.
Maven 3 Support for Jenkins Free-style Jobs
The Jenkins Artifactory plugin supports running Maven 3 builds from free-style jobs by using a Maven 3 build step + a build environment section for the Artifactory Maven 3 integration (artifact and build information deployment).
For Maven 3 builds users are encouraged to configure the Artifactory integration using Jenkins' native Maven 2/3 build projects.

Related

Jenkins pipeline using maven project

I am trying to create a maven project pipeline it show me docker error although i already installed docker integration plugin in jenkins.

choose artifact from artifactory to deploy pipeline job in Jenkins

Is this possible? Suppose I have 2 jobs. One for building artifact and upload it to artifactory with latest version. And another job to deploy the artifact to the server. But I would like to choose the artifact version. Supose A deploy was made and not working , so I redeploy and choose previous artifact (or the one I want to choose). Is this posible in jenkins in a pipleine project? Like a parametrized build or something like that.
Thanks
It will work with the pipelin job . I am it in pipeline job only.
Example: https://wiki.jenkins.io/display/JENKINS/Maven+Metadata+Plugin
Assume that you have 2 jobs .
Job A & Job B. (Both pipeline jobs.)
Job A -> Build and push the artifacts to Artifactory.
Job B -> Fetch the artifact from Artifactory and deploy.
Install the Maven Meta Plugin . https://wiki.jenkins.io/display/JENKINS/Maven+Metadata+Plugin
go to Job B
"This build is parametrerized" checkbox, from the drop-down that appears select the "List maven artifact versions",
configure the artifact you want to retrieve the versions
Name the parameter as deploy_version
In Job B - > Select the version & Click Build.
In pipeline script receive the selected version as param.deploy_version.
Since you know the artifact version and artifact URLs . You can use CURL/httprequest plugin in Jenkisn to download the necessary
artifact from Artifactory (I am using Maven Ansible artifactory
plugin to download)
Continue with your deployment.
According to this answer :
https://stackoverflow.com/a/34781604/3957754
The artifactory plugin for Jenkins has the option to "resolve" artifacts, i.e. download them from Artifactory. But this may require the Pro version with payment $_$
Download artifact using artifactory jenkins plugin (With Payment)
Configure your artifactory plugin
https://medium.com/#anusha.sharma3010/integrating-jenkins-with-artifactory-6d18974d163d
https://www.jfrog.com/confluence/display/RTF/Jenkins+Artifactory+Plug-in
In resolve section, you could download your artifacts
Download artifact using commandline and maven
configure maven and artifactory authentication
https://docs.gitlab.com/ee/ci/examples/artifactory_and_gitlab/
https://blog.bosch-si.com/developer/setting-up-maven-and-artifactory/
download artifact from artifactory
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get \
-DrepoUrl=http://my_artifactory-url.com \
-Dartifact=groupId:artifactId:version
Source: How can I download a specific Maven artifact in one command line?

How to configure jenkins to upload build artifact to nexus?

I have jenkins jobs that builds ios and android app and i want jenkins to upload those artifact to nexus after build is done.Is there any way to do it?
Thanks
If you are building the apps with Maven or Gradle or whatever (esp. the Android ones) a simple mvn deploy or gradle uploadArchives will do the trick. Same applies if you build the ios app with one of these tools.
In most other cases you can always do normal upload via the REST API.
Examples for the Maven and Gradle setup are in the eval guide and the examples to the Nexus book.
Use the Nexus Artifact Uploader Plugin, and set up a new job where you set a build step to Copy artifacts form another project, and a step to Upload artifact to Nexus

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.

Resources