How to activate a Maven Profile for a specific module in a mutli-module project

后端 未结 2 626
天命终不由人
天命终不由人 2021-01-18 16:34

We have a multi-module Maven project consisting of a parent POM and 5 or more modules.

Each module can be deployed to a running server as part of the build if we act

2条回答
  •  清酒与你
    2021-01-18 17:13

    Check out Maven: The Complete Reference - Section 6.2. Using Advanced Reactor Options.

    Starting with the Maven 2.1 release, there are new Maven command line options which allow you to manipulate the way that Maven will build multimodule projects. These new options are:

    -rf, --resume-from

       Resume reactor from specified project
    

    -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
    

    To build only module-b from the root directory:

    $ mvn --projects module-b install

提交回复
热议问题