Search code examples
buildcontinuous-integrationhudsonjenkinsparameterized

select maven modules at Jenkins/Hudson builds


I have a lot modules for my Jenkins build server. Instead of declaring new modules for each of them, I would like to share a common configuration and select my modules before starting my build in a tree view. Let's say my root parent project has A,B,C,D projects and each of them has A1,A2,B1,B2,B3 etc... I would like to choose B1,A1 only to build.

Is there any plugin for this?

Thanks


Solution

  • You can use a feature of Maven3 advanced reactor options and choose which project you would like to build, i.e.:

    mvn -pl B1,A1
    

    You can use additional switches to decide how to handle dependant projects:

    -pl, --projects
        Build specified reactor projects instead of all projects
    -am, --also-make
        If project list is specified, also build projects required by the list
    -amd, --also-make-dependents
        If project list is specified, also build projects that depend on projects on the list
    

    In this scenario providing a list of projects is a piece of cake, using project parameters as the most obvious example. You can even create a plugin to support custom parameter type with Maven modules names and artifacts IDs as names/values.