How to configure a mvn -am -pl by pvb52213

VIEWS: 178 PAGES: 4

									How to configure a mvn -am -pl <module>...


         Felipe Cypriano 34 posts since
Mar 18, 2009
Hello,



I've a project which consists of 3 sub modules, like this:



/project/web

-- commons

-- entites

-- services



The dependency between is pretty simple, entities depends on commons; and services
depends on entities and commons. When I want to compile and package the services I need
to manually execute the install goal on commons and entities before packing the services
module. This is how I currently do.



I've found a maven command that simplifies this process but I don't know how to configure
IDEA to run the command:



$ cd /project/web

$ mvn -am -pl services install


$ mvn -am -pl vc-services install




Generated by Clearspace on 2010-03-19+03:00
                                                                                            1
How to configure a mvn -am -pl <module>...


[INFO] Scanning for projects...


[INFO] Reactor build order:


[INFO] web


[INFO] commons


[INFO] entities


[INFO] services


...



[INFO] ------------------------------------------------------------------------


[INFO] Reactor Summary:


[INFO] ------------------------------------------------------------------------


[INFO] web ................................................ SUCCESS [3.687s]


[INFO] commons ............................................ SUCCESS [2.916s]


[INFO] entities ........................................... SUCCESS [6.102s]


[INFO] services ........................................... SUCCESS [0.330s]


[INFO] ------------------------------------------------------------------------



Generated by Clearspace on 2010-03-19+03:00
                                                                                  2
How to configure a mvn -am -pl <module>...


[INFO] ------------------------------------------------------------------------


[INFO] BUILD SUCCESSFUL




When I execute this maven automatically find the modules that services depends on and
execute the install goal before execute install on services. How could I do this inside IDEA?

Tags: maven, configuration


         Russ 41 posts since
Aug 30, 2007 1. Re: How to configure a mvn -am -pl <module> <goal> in Run config? Dec 22, 2009 8:10 PM

Do your sub modules inherit from a parent pom? If they do you can add your sub modules
to the <modules> section of the parent pom and just run a "mvn install" at the parent pom
level and it will build/install all the modules in the correct order without having to do it
manually.



         Felipe Cypriano 34 posts since
Mar 18, 2009 2. Re: How to configure a mvn -am -pl <module> <goal> in Run config? Dec 22, 2009 8:22 PM

Hi Russ, yes it works for my current project.



But, my concern asking this is because this option only execute the goal on the direct
dependencies instead of all. I think it would be a good option to have in IDEA.



         Felipe Cypriano 34 posts since
Mar 18, 2009 3. Re: How to configure a mvn -am -pl <module> <goal> in Run config? Dec 22, 2009 9:04 PM

I've found an alternative way that works just like -am -pl (which I don't know exactly what it
mean), let's suppose our project web has another module called war:




Generated by Clearspace on 2010-03-19+03:00
                                                                                                         3
How to configure a mvn -am -pl <module>...


/project/web


-- commons


-- entites


-- services


-- war




And we want to install on local repository only commons, entities and services; this will be
possible to execute mvn package on the war. I don't want to install a war, so to this just
execute:



mvn reactor:make -Dmake.folders=services




Generated by Clearspace on 2010-03-19+03:00
                                                                                               4

								
To top