I am working on a project that I need to build a maven pipeline for versioning and release. I am doing like this:
mvn versions:set -DnewVersion=2.0.0
.2.0.0-SNAPSHOT
. BUT HOW CAN I return this value and feed it to another plugin?I know I can handle every step by a CL command but what I want to know and confused me is that how to embed everything in pom.xml
and just run mvn install
and nothing else.
Each plugin needs some arguments that should be able to change that. I know I can use the <argument>
tag under <configuration>
, but some of the plugins do not have the argument tag.
How can I have a solid solution and config everything in my parent POM beforehand?
Also I do have my own plugin but I am not sure if it is possible to embed all things to that and I just run myplugin:Install
.
For building a SNAPSHOT, you usually just run mvn clean verify
on your project. If you need special plugins, you can configure them in the configuration
section following the advice in the plugin description.
For building a release version, you should use a build server (like Jenkins). There, you can construct all the steps much easier than in Maven. If for some reason, you cannot do that, use the maven release plugin.