POM not released using Jenkins and Artifactory Release - jenkins

We're trying to use the Artifactory release process in Jenkins to publish a jar file created by a Gradle build into a Maven repo in our Artifactory server.
It nearly all works, the only issue is that the pom file isn't being copied into the Artifactory repo.
The Gradle build includes the Gradle Maven plugin and running gradlew install locally results in both the jar and the pom inserted into the local Maven repo.
I've added a task in the Gradle build that generates the pom file in the same directory as the jar file and changed the Jenkins build to run that task too.
When the build has completed I can see both the jar and the pom file in the workspace.
Any ideas on what I need to do to get the pom file published along with the jar?
We're using:
Jenkins 2.10
Artifactory plugin 2.4.4
Gradle 2.14
The Gradle build file does not inlcude the Gradle Artifactory plugin.
Cheers, Andy
The Jenkins project is configured to use the Gradle-Artifactory integration (rather than the Generic-Artifactory integration).

As suggested by Dakota Brown I'm answering my own question, the solution to my problem was to un-tick the maven3 integration option. With that option unslected, everything works as expected.

Related

Deploying the root pom.xml to artifactory via jenkins?

I'm uploading from jenkins to artifactory and my whole maven project is built with:
mvn clean install
The project has
Result of the Deploy to Artifactory:
How do I get the root pom.xml to the artifactory? I reference this from other project and it does not build because of it. All the other modules are deployed and their POMs as well.
It seems that the reason that it did not work was that I had included an include pattern in the deploy maven artifacts, I removed the ".xml, *.jar" and it deployed correctly.

Jenkins build without maven

I have a java project which I build and export it as a jar using eclipse. Then I deploy the jar.
Also my project uses dependencies e.g. Apache POI etc. I include these jars in the build path and then clean build and export it as a jar.
I want to build the jar using Jenkins. Please suggest the script and command to perform the same task without using maven. I have to build the code from Gitlab.

Jar versioning in Jenkins

On each maven build or release, how to get new jar version in Jenkins. I have tried it in Jenkins but only getting same jar file name as it is in pom file.
you can use maven-exec-plugin to print the version to stdout or write it in a file:
mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:exec

.m2 is not getting updated with latest xmlbeans jar files

I do have a jenkins job that builds XML beans jar files from the internal gitlab project and puts it on the artifactory. While having a build, this XML beans jar files are downloaded to the .m2 maven local repository. However, if this jar file exists in the .m2 repository then maven does not bother to download it from the artifactory. With being said, if there is a gitlab change, it does build it and put it on the artifactory. As there is already a jar file exist in .m2 repository, an old jar file is not being replaced with the new one. We ended up a wrong dependency to the customer with a release.
The question is , What am I doing wrong here?
mvn clean install -U
-U means maven will force update snapshot dependencies. Release dependencies can't not be updated this way.

When deploying to Archiva from Jenkins is it necessary to change a settings.xml file where maven is concerned?

I am trying to deploy from Jenkins to Archiva. I'm not very sure how it all works. I have a maven project and I have read that I need to change a settings.xml file. I cannot find such a file in my Archiva 2.0 directories.
While in Jenkins I am using the ArtifactDeployer plugin. When I try to enter the directory from which to get the artifacts there is an error saying it does not exist.
How can I resolve this problem?
Within Jenkins, you need to register the build tools that Jenkins will use.
In regard to the buld tool Maven, I suggest:
Download, unzip, and install Apache Maven to the server on which Jenkins runs.
Configure your Maven's conf/settings.xml to point to your Archiva installation.
Configure the M2_HOME and PATH variables so that the mvn command can be executed.
Configure Jenkins to use the Apache Maven installation that you just configured.
The point is, that's a sure fire way to locate and edit a settings.xml file.
If you have Jenkins download Maven for you (I generally don't do this), then you'll have to look for a path to where Jenkins installed Maven.

Resources