How to release submodules with different version numbers with Maven? - maven

In my current maven project I have a lot of submodules. I need to build a release and deploy it to my nexus...
Now I am facing the challange that I need for some of the modules differing version numbers. How can I handle this by usage of the release & deploy plugin? Or do I need some other maven plugins??? I configured the release plugin inside the parant pom. Is there a possibility to disable for example the "autoVersionSubmodules" for some of the submodules? Any ideas???

If you have a multi-module build than all modules should have the same version number otherwise it's an indicator that the multi-module build is not the right choice.

Related

Can Maven a plugin use itself as a plugin?

I've written a Maven plugin which we're using as part of our release process - as well as the usual release basically does some extra admin. I'd like to use this plugin for releasing the plugin itself but I'm not sure this is possible.
If I include the plugin in its own POM, using ${version} as the version number then I can't release because before deploying the release build it can't find the release build in the Nexus repo. If I use an earlier version, I get a clash (I don't think Maven likes two versions of the same project at once) and I'm not having any luck using a 'provided' scope as the plugin tag doesn't support this.
Is what I'm trying to do possible or should I resign myself to having a different release procedure for the plugin itself?
Thanks,
-Dave

Change to next SNANPSHOT version in all modules of multi-module project

I have a multi-module projects where the modules have all different non-SNAPSHOT versions. I want to change them all to the next SNAPSHOT version. With versions:set I need to explicitly set a new version, I would like to change all modules to [Current-Version+0.1]-SNAPSHOT. Is there an easy way to do this?
Try playing around with the use-next-snapshots goal of the Versions Maven Plugin
http://mojo.codehaus.org/versions-maven-plugin/use-next-snapshots-mojo.html

Increment maven project release

I need to increment the project and subprojects release version , whitout create the new SNAPSHOT version.
I tried to use the Maven release plugin, but i found some incompatibility with my scm.
There are a plugin for only increment de buildnumber of a release named like 1.0-buildnumber?
I think I have wrongly interpreted the functions of the plug-in versions.
I did some tests, and I understand that this plugin allows you to update the pom.xml if the respective release has already been published.
This is not my case, what I need instead is to increase the release by increasing the BuildNumber so that the next phase of development can work using a new version of the project and subprojects.
I understand that this thing can be done only with the Maven release-plugin, but only in the context of using a scm.
If so,Thanks anyway for the support and sorry if I wasted your time.

How to do continuous integration with Hudson for Maven 3 multi-module projects well?

It is my current impression that is impossible to do CI for a Maven 3 multi-module project well using Hudson (or Jenkins).
The situation seems to be that you have 2 realistic options of building a multi-module Maven 3 project with Hudson:
A freestyle project can also Build Maven projects, and with the incremental/recursive option it apparently should be able to deal with building only the necessary subtrees of the complete project tree.
A legacy, severly deprecated, with lots of warnings, Maven2/3 legacy build.
With the first option there is the significant disadvantage that your complete project looks like one big blob in Hudson, there is no visibility on the individual subprojects and there is no option for building individual subprojects and their dependees.
With the second option you have to basically swallow very little faith inducing warnings about legacy and "do not use" in order to find out that yes, it will build your multi-module project but the functionality of triggering subproject builds is completely broken and there is no intention of fixing this.
The only alternative I can figure out is to revert to Maven 2 for the build on the server, in which case the legacy plugin seems to work and even the individual sub-project builds can be triggered. But then I'm stuck on Maven 2.
I find my requirements to be rather conservative but I am completely stymied by the lack of Maven support in Hudson/Jenkins. Here's what I would expect:
ability to recognize multi-module projects and build them using Maven 3
ability to have "incremental" builds of such a multi-module project (i.e. only changed modules and its dependees)
ability to see the current status of the multi-module project and what sub-module has failed/succeeded/is unstable
The Maven project in question consists of about 84 Maven modules in a multi-module configuration with a common parent and a split into different subsystems. We are using Hudson 3.1.0.
Do I have any chance of achieving this?
Yes, it is impossible to do it well with the current Maven 2/3 project type.
I have done it well enough using a matrix / multi-configuration project type, and adding a "Module" axis manually. The configuration of the matrix job is a pain, and you have to remember to update your axis any time you add, remove or rename a module. But once configuration is complete, this solution works well for building. You can see the build and test results for each module separately, or integrated under the matrix job.
My colleague has been working on implementing Maven 3 multi-module functionality in Jenkins.
https://github.com/adamcin/maven-plugin
Not sure what the upstream acceptance status is.

Tycho: Parent POM needs to list plug-ins included in my feature?

I am transitioning from using Buckminster to build an Eclipse product to Tycho. I've mavenized my plug-ins and features and have a question:
I created a parent feature with a POM that references my features and plugins. I don't know if I am doing this correctly, but I find that I need to add all features and plugins as modules. So if I have pluginA, pluginB and feature1 that includes pluginA and pluginB, I add all three to parent POM. This is a bit strange to me, because in Buckminster I had to reference only feature1 and it would get its dependencies based on the feature.xml file.
I am doing something wrong in my Tycho builds, or is this how it's suppose to work?
A Tycho build is driven by Maven, i.e. Maven first determines which modules should be part of the build reactor, and then Tycho builds the modules. Therefore, you'll need an aggregator POM that tells Maven about the list of artifacts to be built.

Resources