I have a Maven kernel project. In the project pom.xml version 0.1. I use a parameterized assembly in Jenkins and set the text parameter myNewVersion = 3.1. I also set the following maven goals:
versions:set -DnewVersion=${myNewVersion} versions:commit deploy
When building, maven upgrades the version in pom.xml to "3.1". However, the maven deployment task deploys my project as βcore-0.1,β and the version remains 0.1. The pOM file contained in the corresponding 0.1 dir in my Nexus indicates the version number is "3.1".
What can I do to get the maven deployment task to use the correct version installed by the maven version plugin?
Many thanks for your help.
EDIT 1: To clarify my needs: the project version in POM should not indicate the actual version of the assembly. I use it to determine the compatibility of my "main" project with base systems and APIs. In more detail: the "core" project receives from jenkins the parameter "interfaceVersion = 3.1" or "interfaceVersion = 4.0". This determines which version of my main project is used to depend on another library package.
Now I have two tasks for creating Jenkins, one for 3.1 and one for library 4.0 project dependency for the main project. Each one checks the same project code from SVN, but passes the other version to the kernel project under construction. I want to use this version number as the number of my version of the project in pom.xml And as the version number of my jar, which is deployed to nexus (for example, core-3.1.jar or core-4.0.jar).
Edit 2: I came a little further. I just use the version parameter that I set in jenkins as a parameter in my parameterized build section as the project version number in the pom file. Maven warns about this, but it works. However, all my projects depending on the "kernel" should now also specify "$ myNewVersion" as the version of the dependency.
So, I'm trying to use version-maven-plugin again to install / overwrite the version in the pom file, as I said above. However, now I get an "Access Denied" error message when using the maven deployment. If I remove the "version: set -DnewVersion = $ {myNewVersion} version: commit" and just use "deploy", it works. Is there any way to solve this problem?
Hombrefab
source share