6

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 executed only on one child module but not the other one. Could someone provide any advice on the best way of doing this ?

Thanks

user465374
  • 1,521
  • 4
  • 20
  • 39

3 Answers3

6

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>
Community
  • 1
  • 1
Raghuram
  • 51,854
  • 11
  • 110
  • 122
  • Note that not all plugins support this configuration, so do make sure to check the plugin goal configuration! For example `maven-compiler-plugin` uses `skipMain`. – Peter Mularien Apr 29 '13 at 15:55
1

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

Salandur
  • 6,409
  • 2
  • 22
  • 23
0

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
Willie Z
  • 476
  • 7
  • 12