简体   繁体   中英

Running custom pom.xml in child module of Maven Project?

I have a java maven project which has 1 parent pom and 3 child modules associated with it. One of the child module has a custom pom.xml alongwith the default pom.xml. If I run mvn clean install on Parent pom, all the 3 child modules (with default pom.xml) gets executed.
I wanted to run custom pom.xml instead of default pom.xml for one of the child module. I tried below:

mvn -pl module1,module2/custom.xml,module3 clean install

But it didn't work and I got below error:
[ERROR] [ERROR] Could not find the selected project in the reactor:module2/custom.xml

Instead of having custom pom for one module, you can use maven profile to achieve custom behavior in some build.

You can run maven build with:

mvn -P profile_name clean install

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM