You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by sarmahdi <sa...@hotmail.com> on 2012/03/23 22:24:45 UTC

Compile all projects respectively

Hello All!

I have three projects. an EAR, a WAR and a JAR project. and they are all
depended on each other. Like Jar is compiled and deployed in maven repo,
from there it is added into the WAR and war is deployed in the repo and from
there the WAR is added into the EAR. 

For each project I have to do mvn.bat scm:update clean install one by one
and in that order Jar then war and then the EAR. Is there a way I can just
do :> mvn.bat scm:update clean install in the ear project and it will start
with the jar (update the files then clean the target and then install) then
the war (add the first jar in it) and then do it for the ear. (the jar can
be added here as well doesnt matter, it works both ways: inside the
war/WEB-INF/lib and inside the EAR side by side the war) so i have to run
the command only once

Thanks and I will appreciate the tips.

Syed...



--
View this message in context: http://maven.40175.n5.nabble.com/Compile-all-projects-respectively-tp5590742p5590742.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compile all projects respectively

Posted by sarmahdi <sa...@hotmail.com>.
Vey concisely explained. Thanks Wayne. 

--
View this message in context: http://maven.40175.n5.nabble.com/Compile-all-projects-respectively-tp5590742p5591750.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compile all projects respectively

Posted by Wayne Fay <wa...@gmail.com>.
> So i only have a java project a web project and an ear project. Is there a
> way i can do this using the current projects I have. I dont want to add new
> projects.

You simply need to add a parent project of type pom and then make a
<module> entry for each of the jar, war, and ear projects inside it.
This is required if you want to achieve the goals you desire.

I am unaware of any option which allows you to keep things as they
are, with no changes and yet simultaneously build all projects with
one single execution of Maven.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compile all projects respectively

Posted by sarmahdi <sa...@hotmail.com>.
Thanks for the reply so soon.

I dont have a Pom package. I didnot use any architype to generate my
projects,. They were already built in eclipse I just mavenized them .

So i only have a java project a web project and an ear project. Is there a
way i can do this using the current projects I have. I dont want to add new
projects.

Thanks.
Syed...

--
View this message in context: http://maven.40175.n5.nabble.com/Compile-all-projects-respectively-tp5590742p5590777.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Compile all projects respectively

Posted by John Patrick <nh...@gmail.com>.
Look into pom packages, then that maven project has your jar, war and
ear as modules.

./pom.xml (i.e project-pom package type pom)
<project...
   [...]
   <package>pom</package>
   [...]
   <modules>
      <module>jar</module>
      <module>war</module>
      <module>ear</module>
   </modules>
   [...]
</project>

./jar/pom.xml (i.e. project-jar package type jar)
./war/pom.xml (i.e. project-war package type war)
./ear/pom.xml (i.e. project-ear package type ear)

then in ./ execute your maven command and it will build your
dependencies in order.

John

On 23 March 2012 21:24, sarmahdi <sa...@hotmail.com> wrote:
> Hello All!
>
> I have three projects. an EAR, a WAR and a JAR project. and they are all
> depended on each other. Like Jar is compiled and deployed in maven repo,
> from there it is added into the WAR and war is deployed in the repo and from
> there the WAR is added into the EAR.
>
> For each project I have to do mvn.bat scm:update clean install one by one
> and in that order Jar then war and then the EAR. Is there a way I can just
> do :> mvn.bat scm:update clean install in the ear project and it will start
> with the jar (update the files then clean the target and then install) then
> the war (add the first jar in it) and then do it for the ear. (the jar can
> be added here as well doesnt matter, it works both ways: inside the
> war/WEB-INF/lib and inside the EAR side by side the war) so i have to run
> the command only once
>
> Thanks and I will appreciate the tips.
>
> Syed...
>
>
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/Compile-all-projects-respectively-tp5590742p5590742.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org