Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

specify pom.xml in mvn command and mix goals of other project

I have multiple questions.

  1. Can I specify the pom.xml in mvn command?
  2. Can I mix the goals of another project while executing mvn command on current project ?

    Eg: mvn clean-otherproject comple-otherproject instal-otherproject compile-thisproject

I can do this with multiple mvn commands, but Can I do this in single maven command.

like image 427
srinannapa Avatar asked Oct 26 '10 12:10

srinannapa


People also ask

Can a project have multiple POM files?

Yes you can use Maven Profiles to manage this. Obviously you can tweak this approach to suit your needs however works best.

What is project POM XML?

A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project. It contains default values for most projects.


1 Answers

Just mvn --help would have answered the first question:

 mvn -f otherPomFile.xml 

No. You can simple execute the phases for the current project you are in. You can give multiple phases like

mvn clean install site site:deploy 
like image 56
khmarbaise Avatar answered Sep 22 '22 06:09

khmarbaise