how to upload ear files into nexus for non maven project - jenkins

currently we are using manual upload through GUI of nexusI have a Java project (which is not a maven project means no POM.xml) and SVN repo and jenkins(using ant script for build) for CI. The build process creating War and Ear files locally in jenkins workspace. I want to upload this EAR to Nexus repository. It doesn't use Maven for builds. And I'd rather not introduce Maven/POM files just to get files into Nexus.
So, what's the best (or any reasonable) way to upload build artifacts to a Nexus repository without Maven?

Related

Upload multiple files to Jenkins workspace

I am manually creating text files in remote windows location to build a job in Jenkins.
Is this possible using any plugin , that i can create these files in Jenkins workspace.
Currenlty i checked File Operations Plugin , but this does not create different files as this one is only uploading a single file.

jfrog artifactory CLI deploy a jar in maven artifactory repo with inferred setting from jar

I am using Visual Studio Artifactory deployer to deploy jar files built by maven to Artifactory maven repo. If I use maven artifactory plugin the jar file gets deployed to right folder structure and maven setting stay as per the jar but from CLI if i push the jar file, it only get deployed as a jar file to the folder I specify. For example
Using CLI push a artifact.jar to target libs-snapshot/com/foo/bar
gets file uploaded to libs-snapshot/com/foo/bar and artifactory has
no information about jar version, group id , artifact id. I could not
find any options on the CLI to specify those.
While using Maven Artifactory plugin, a pushed jar ends up in
libs-snapshot/com/foo/bar/artifact/version folder and maven
properties stay intact
How do I achieve same behaviour from CLI as maven artifactory plugin does.
Just to make sure, how do you use the CLI for the deployment? In order to have it deployed to Artifactory using the CLI, you will have to specify the right Maven coordinates. For example:
jfrog rt u mySnapshot-1.0.0-SNAPSHOT.jar “libs-snapshot-local/path/to/folder/mySnapshot/1.0.0-SNAPSHOT/”
This will deploy your snapshot file to Artifactory and Artifactory, base on your repository configuration will replace the “SNAPSHOT” with a timestamp.
If you meant that you want to deploy 5 different files, to 5 different paths and that you wish that the JFrog CLI to extract the maven layout and deploy by it, then this is not possible by using the CLI.

How to deploy delphi exe output to artifactory using jenkins

I use a script in Jenkins to build delphi projects and I want to deploy their .exe outputs to Artifactory server but I dont know how. Is there any plugin to deploy exe files to Artifactory?
Is it a good idea to deploy them to Artifactory?
The best would be using the Jenkins Artifactory plugin.
The plugin allows your build jobs to deploy artifacts automatically to Artifactory and have them linked to the build job that created them.
The support for generic (freestyle) builds is probably the most suitable one for deploying the .exe files. As part of the support for generic builds, you will be able to defined patterns for selecting which files would be deployed and to where.

Jenkins ArtifactDeployer simple creates a new dir in base dir?

I am in Jenkins and using ArtifactDeployer. The console output tells me that the remote repo is http:// myrepo but all it does is create a new folder in my base directory which I also specify in this plugin. It correctly finds only one file to copy but strangely just creates a new directory and copies it in there. I thought this would enable me to deploy artifacts to another server... Can I do that?
No you can not do that with artifacts deployer but there are other ones you can use - read below:
Jenkins provides by default a feature for archiving artifacts generated by the build of a Jenkins Job. These artifacts are archived in the JENKINS_HOME directory. However, this directory contains also tool configurations (global and job configurations). Therefore, there is no separation between infrastructure data, jobs data and generated elements. It is often considered to be a bad practice and it doesn't help to manage it from an administrator point of view.
Unfortunately, it's not possible to extend the 'archived artifacts' feature to archive artifacts in a location other than JENKINS_HOME.
The main goal of the ArtifactDeployer plugin is to archive artifacts in your desired locations (other than JENKINS_HOME directory).
There are many Jenkins plugins close to ArtifactDeployer such as CopyArtifact plugin or CopyArchiver plugin for publishing artifacts from Jenkins resources (from the current workspace, from the old builds of the same job or other jobs, ...) to remote locations with the protocol file://
There are also others plugins for managing other protocols such as ftp://, ssh:///.

Generate archetype using ant build file

I am trying to write an ant build file which I want to generate the archetype from a remote repository.
How this can be achieved. I have read the ant tasks for maven and all it talks is about dependencies and installing deploying etc. How can we generate the archetype to our local machine from the remote repository.

Resources