Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to skip lifecycle phase in multi maven module

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

like image 541
user465374 Avatar asked Apr 07 '11 09:04

user465374


Video Answer


2 Answers

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>
like image 153
Raghuram Avatar answered Oct 18 '22 23:10

Raghuram


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

like image 20
Salandur Avatar answered Oct 18 '22 23:10

Salandur