How to skip lifecycle phase in multi maven module

后端 未结 3 388
南笙
南笙 2021-01-12 15:41

I have a maven multi module project which call two sub modules. please note that this child module do not use the parent markup tag. Now I need to have the deploy phase exe

相关标签:
3条回答
  • 2021-01-12 16:20

    As mentioned in this FAQ for maven deploy plugin, as well as in this SO discussion, you should add the following in the pom of the module you do not want to deploy.

            <plugin>
               <artifactId>maven-deploy-plugin</artifactId>
               <version>X.Y</version>
               <configuration>
                 <skip>true</skip>
              </configuration>
            </plugin>
    
    0 讨论(0)
  • 2021-01-12 16:23

    you can go into the directory of the submodule and execute the goal there.

    it is also possible to execute a specific module from the 'parent' with the --also-make option. see http://maven.apache.org/guides/mini/guide-multiple-modules.html

    0 讨论(0)
  • 2021-01-12 16:23

    multiple-module maven project can specify on which submodule to execute phases with parent pom.xml.

    1. Go to where the parent pom.xml is
    2. execute: mvn --projects [target-module-artifactId] [phase/goal]. For example: mvn --projects submodule1 deploy
    0 讨论(0)
提交回复
热议问题