RE: need help on maven compile phase.

2008-06-17 Thread nicklist
You have to restructure your project.

Like:
module-name-pkg1/src/main/java/com/abc/xyz/pkg1
module-name-pkg1/src/test/java/com/abc/xyz/pkg1
module-name-pkg1/pom.xml

module-name-pkg2/src/main/java/com/abc/xyz/pkg2
module-name-pkg2/src/test/java/com/abc/xyz/pkg2
module-name-pkg2/pom.xml

module-name-pkg3/src/main/java/com/abc/xyz/pkg3
module-name-pkg3/src/test/java/com/abc/xyz/pkg3
module-name-pkg3/pom.xml

module-name-pkg4/src/main/java/com/abc/xyz/pkg4
module-name-pkg4/src/test/java/com/abc/xyz/pkg4
module-name-pkg4/pom.xml

pom.xml

The aggregate pom (now your main pom) should contain a modules section, like:

   module-name-pkg1
   module-name-pkg2
   module-name-pkg3
   module-name-pkg4


After that you would want your dependencyManagement in your aggregate pom and 
add a  section to your module pom files. Then strip all version numbers 
in the dependencies section in your module poms and add them to the 
dependencyManagement section.

All in all, a fairly big refactoring, but take a good look at the book at 
sonatype. All the elements are explained there.

Hth,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl



-Original Message-
From: Niranjan Deshpande [mailto:[EMAIL PROTECTED]
Sent: Tue 6/17/2008 17:13
To: Maven Users List
Subject: Re: need help on maven compile phase.
 
there are indeed seperate test classes for all those packages.
but what i m not understanding is how do i write seperate poms for each
pakage. and where do i kep that pom? and how do i call it?

right now I am using one pom in the prj_home dir.


On 6/17/08, Mark Struberg <[EMAIL PROTECTED]> wrote:
>
> The easiest way is to split your sources into separate maven modules.
> If you have 1600 classes, this imho makes sense anyway!
>
> I (personally) mean, if a project is _that_ fat, then a modularisation
> would help to better understand the whole application. Each modules should
> have their own unit tests, etc. Simply, the whole bunch of straight forward
> computer engineering rules one learns in university.
>
> LieGrü,
> strub
>
>
> --- Niranjan Deshpande <[EMAIL PROTECTED]> schrieb am Di, 17.6.2008:
>
> > Von: Niranjan Deshpande <[EMAIL PROTECTED]>
> > Betreff: Re: need help on maven compile phase.
> > An: "Maven Users List" 
> > Datum: Dienstag, 17. Juni 2008, 14:46
> > I tried increasing the memory using the maxmem and
> > memintial, initial=512mb
> > and mac=2048m. still the same error. my 1642 files have
> > been distributed
> > accross four packages. src/main/java/com/abc/xyz/pkg1
> >
> > pkg2
> >
> > pkg3
> >
> > pkg4
> >
> > whould i write seperate POMs for each pkg? where should
> > these POMs be
> > present.
> > then what about the main POM in the prj_home/dir?
> >
> >
> > On 6/17/08, RAM <[EMAIL PROTECTED]> wrote:
> > >
> > > Actually, I can think of seperate module inside the
> > main root project and a
> > > seperate pom.xml for each one. Then you can build
> > those one by one.
> > >
> > > Else, try increasing the memory with the compiler
> > plugin (I think, you have
> > > atleast 1.5 GB RAM)
> > >
> > > 
> > >
> > org.apache.maven.plugins
> > >
> > maven-compiler-plugin
> > >
> > >  512m
> > >  1024m
> > >
> > >  
> > >
> > > This may resolve the out of memory error.
> > >
> > > Regards,
> > > Ram
> > >
> > > On 6/17/08, Niranjan Deshpande
> > <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi all
> > > > My prj_home_dir/src/main/java has about 1642
> > classes. When Maven executes
> > > > the compile life cycle, all tha 1642 classes are
> > compiled at once and i
> > > > always get a out of memory error. Is there a way
> > that i can instruct
> > > maven
> > > > to compile in steps. e.g web layer first, then
> > the business layer etc.
> > > >
> > > > Please guide.
> > > > --
> > > > Regards,
> > > > Niranjan Deshpande
> > > >
> > > > "Shut yourself from the world and create the
> > reality you want"
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks
> > > Ram
> > >
> >
> >
> >
> > --
> > Regards,
> > Niranjan Deshpande
> >
> > "Shut yourself from the world and create the reality
> > you want"
>
>
>  __
> Gesendet von Yahoo! Mail.
> Dem pfiffigeren Posteingang.
> http://de.overview.mail.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Regards,
Niranjan Deshpande

"Shut yourself from the world and create the reality you want"



Re: need help on maven compile phase.

2008-06-17 Thread Niranjan Deshpande
there are indeed seperate test classes for all those packages.
but what i m not understanding is how do i write seperate poms for each
pakage. and where do i kep that pom? and how do i call it?

right now I am using one pom in the prj_home dir.


On 6/17/08, Mark Struberg <[EMAIL PROTECTED]> wrote:
>
> The easiest way is to split your sources into separate maven modules.
> If you have 1600 classes, this imho makes sense anyway!
>
> I (personally) mean, if a project is _that_ fat, then a modularisation
> would help to better understand the whole application. Each modules should
> have their own unit tests, etc. Simply, the whole bunch of straight forward
> computer engineering rules one learns in university.
>
> LieGrü,
> strub
>
>
> --- Niranjan Deshpande <[EMAIL PROTECTED]> schrieb am Di, 17.6.2008:
>
> > Von: Niranjan Deshpande <[EMAIL PROTECTED]>
> > Betreff: Re: need help on maven compile phase.
> > An: "Maven Users List" 
> > Datum: Dienstag, 17. Juni 2008, 14:46
> > I tried increasing the memory using the maxmem and
> > memintial, initial=512mb
> > and mac=2048m. still the same error. my 1642 files have
> > been distributed
> > accross four packages. src/main/java/com/abc/xyz/pkg1
> >
> > pkg2
> >
> > pkg3
> >
> > pkg4
> >
> > whould i write seperate POMs for each pkg? where should
> > these POMs be
> > present.
> > then what about the main POM in the prj_home/dir?
> >
> >
> > On 6/17/08, RAM <[EMAIL PROTECTED]> wrote:
> > >
> > > Actually, I can think of seperate module inside the
> > main root project and a
> > > seperate pom.xml for each one. Then you can build
> > those one by one.
> > >
> > > Else, try increasing the memory with the compiler
> > plugin (I think, you have
> > > atleast 1.5 GB RAM)
> > >
> > > 
> > >
> > org.apache.maven.plugins
> > >
> > maven-compiler-plugin
> > >
> > >  512m
> > >  1024m
> > >
> > >  
> > >
> > > This may resolve the out of memory error.
> > >
> > > Regards,
> > > Ram
> > >
> > > On 6/17/08, Niranjan Deshpande
> > <[EMAIL PROTECTED]> wrote:
> > > >
> > > > Hi all
> > > > My prj_home_dir/src/main/java has about 1642
> > classes. When Maven executes
> > > > the compile life cycle, all tha 1642 classes are
> > compiled at once and i
> > > > always get a out of memory error. Is there a way
> > that i can instruct
> > > maven
> > > > to compile in steps. e.g web layer first, then
> > the business layer etc.
> > > >
> > > > Please guide.
> > > > --
> > > > Regards,
> > > > Niranjan Deshpande
> > > >
> > > > "Shut yourself from the world and create the
> > reality you want"
> > > >
> > >
> > >
> > >
> > > --
> > > Thanks
> > > Ram
> > >
> >
> >
> >
> > --
> > Regards,
> > Niranjan Deshpande
> >
> > "Shut yourself from the world and create the reality
> > you want"
>
>
>  __
> Gesendet von Yahoo! Mail.
> Dem pfiffigeren Posteingang.
> http://de.overview.mail.yahoo.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Regards,
Niranjan Deshpande

"Shut yourself from the world and create the reality you want"


Re: need help on maven compile phase.

2008-06-17 Thread Mark Struberg
The easiest way is to split your sources into separate maven modules.
If you have 1600 classes, this imho makes sense anyway!

I (personally) mean, if a project is _that_ fat, then a modularisation would 
help to better understand the whole application. Each modules should have their 
own unit tests, etc. Simply, the whole bunch of straight forward computer 
engineering rules one learns in university.

LieGrü,
strub


--- Niranjan Deshpande <[EMAIL PROTECTED]> schrieb am Di, 17.6.2008:

> Von: Niranjan Deshpande <[EMAIL PROTECTED]>
> Betreff: Re: need help on maven compile phase.
> An: "Maven Users List" 
> Datum: Dienstag, 17. Juni 2008, 14:46
> I tried increasing the memory using the maxmem and
> memintial, initial=512mb
> and mac=2048m. still the same error. my 1642 files have
> been distributed
> accross four packages. src/main/java/com/abc/xyz/pkg1
>
> pkg2
>
> pkg3
>
> pkg4
> 
> whould i write seperate POMs for each pkg? where should
> these POMs be
> present.
> then what about the main POM in the prj_home/dir?
> 
> 
> On 6/17/08, RAM <[EMAIL PROTECTED]> wrote:
> >
> > Actually, I can think of seperate module inside the
> main root project and a
> > seperate pom.xml for each one. Then you can build
> those one by one.
> >
> > Else, try increasing the memory with the compiler
> plugin (I think, you have
> > atleast 1.5 GB RAM)
> >
> > 
> >   
> org.apache.maven.plugins
> >   
> maven-compiler-plugin
> >
> >  512m
> >  1024m
> >
> >  
> >
> > This may resolve the out of memory error.
> >
> > Regards,
> > Ram
> >
> > On 6/17/08, Niranjan Deshpande
> <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all
> > > My prj_home_dir/src/main/java has about 1642
> classes. When Maven executes
> > > the compile life cycle, all tha 1642 classes are
> compiled at once and i
> > > always get a out of memory error. Is there a way
> that i can instruct
> > maven
> > > to compile in steps. e.g web layer first, then
> the business layer etc.
> > >
> > > Please guide.
> > > --
> > > Regards,
> > > Niranjan Deshpande
> > >
> > > "Shut yourself from the world and create the
> reality you want"
> > >
> >
> >
> >
> > --
> > Thanks
> > Ram
> >
> 
> 
> 
> -- 
> Regards,
> Niranjan Deshpande
> 
> "Shut yourself from the world and create the reality
> you want"


  __
Gesendet von Yahoo! Mail.
Dem pfiffigeren Posteingang.
http://de.overview.mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: need help on maven compile phase.

2008-06-17 Thread Wayne Fay
The general concept with Maven would be that you should divide your
code up into "modules" along whatever lines that make sense to you (1
module per pkg may be reasonable for your specific implementation, I
suppose).

Then you set up dependencies between the modules via each one's
pom.xml file, and perhaps establish a "parent" which encompasses all
modules. This would be set up like:

parent/pom.xml
parent/pkg1/pom.xml
parent/pkg1/src/main/java/com/abc/xyz/pkg1
parent/pkg2/pom.xml
parent/pkg1/src/main/java/com/abc/xyz/pkg2
parent/pkg3/pom.xml
parent/pkg1/src/main/java/com/abc/xyz/pkg3
parent/pkg4/pom.xml
parent/pkg1/src/main/java/com/abc/xyz/pkg4

So you would have probably 5 pom.xml files if you implemented this.

You should do some reading (Better Builds With Maven etc) and look at
sample projects (many open-source projects use Maven, and you can
browse their code repositories to see how things are laid out and
check out their pom.xml files) to see how this might apply to your
specific situation.

Wayne

On 6/17/08, Niranjan Deshpande <[EMAIL PROTECTED]> wrote:
> I tried increasing the memory using the maxmem and memintial, initial=512mb
> and mac=2048m. still the same error. my 1642 files have been distributed
> accross four packages. src/main/java/com/abc/xyz/pkg1
>pkg2
>pkg3
>pkg4
>
> whould i write seperate POMs for each pkg? where should these POMs be
> present.
> then what about the main POM in the prj_home/dir?
>
>
> On 6/17/08, RAM <[EMAIL PROTECTED]> wrote:
> >
> > Actually, I can think of seperate module inside the main root project and a
> > seperate pom.xml for each one. Then you can build those one by one.
> >
> > Else, try increasing the memory with the compiler plugin (I think, you have
> > atleast 1.5 GB RAM)
> >
> > 
> >org.apache.maven.plugins
> >maven-compiler-plugin
> >
> >  512m
> >  1024m
> >
> >  
> >
> > This may resolve the out of memory error.
> >
> > Regards,
> > Ram
> >
> > On 6/17/08, Niranjan Deshpande <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi all
> > > My prj_home_dir/src/main/java has about 1642 classes. When Maven executes
> > > the compile life cycle, all tha 1642 classes are compiled at once and i
> > > always get a out of memory error. Is there a way that i can instruct
> > maven
> > > to compile in steps. e.g web layer first, then the business layer etc.
> > >
> > > Please guide.
> > > --
> > > Regards,
> > > Niranjan Deshpande
> > >
> > > "Shut yourself from the world and create the reality you want"
> > >
> >
> >
> >
> > --
> > Thanks
> > Ram
> >
>
>
>
> --
> Regards,
> Niranjan Deshpande
>
> "Shut yourself from the world and create the reality you want"
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: need help on maven compile phase.

2008-06-17 Thread Niranjan Deshpande
I tried increasing the memory using the maxmem and memintial, initial=512mb
and mac=2048m. still the same error. my 1642 files have been distributed
accross four packages. src/main/java/com/abc/xyz/pkg1
pkg2
pkg3
pkg4

whould i write seperate POMs for each pkg? where should these POMs be
present.
then what about the main POM in the prj_home/dir?


On 6/17/08, RAM <[EMAIL PROTECTED]> wrote:
>
> Actually, I can think of seperate module inside the main root project and a
> seperate pom.xml for each one. Then you can build those one by one.
>
> Else, try increasing the memory with the compiler plugin (I think, you have
> atleast 1.5 GB RAM)
>
> 
>org.apache.maven.plugins
>maven-compiler-plugin
>
>  512m
>  1024m
>
>  
>
> This may resolve the out of memory error.
>
> Regards,
> Ram
>
> On 6/17/08, Niranjan Deshpande <[EMAIL PROTECTED]> wrote:
> >
> > Hi all
> > My prj_home_dir/src/main/java has about 1642 classes. When Maven executes
> > the compile life cycle, all tha 1642 classes are compiled at once and i
> > always get a out of memory error. Is there a way that i can instruct
> maven
> > to compile in steps. e.g web layer first, then the business layer etc.
> >
> > Please guide.
> > --
> > Regards,
> > Niranjan Deshpande
> >
> > "Shut yourself from the world and create the reality you want"
> >
>
>
>
> --
> Thanks
> Ram
>



-- 
Regards,
Niranjan Deshpande

"Shut yourself from the world and create the reality you want"


Re: need help on maven compile phase.

2008-06-17 Thread RAM
Actually, I can think of seperate module inside the main root project and a
seperate pom.xml for each one. Then you can build those one by one.

Else, try increasing the memory with the compiler plugin (I think, you have
atleast 1.5 GB RAM)

 
org.apache.maven.plugins
maven-compiler-plugin

  512m
  1024m

  

This may resolve the out of memory error.

Regards,
Ram

On 6/17/08, Niranjan Deshpande <[EMAIL PROTECTED]> wrote:
>
> Hi all
> My prj_home_dir/src/main/java has about 1642 classes. When Maven executes
> the compile life cycle, all tha 1642 classes are compiled at once and i
> always get a out of memory error. Is there a way that i can instruct maven
> to compile in steps. e.g web layer first, then the business layer etc.
>
> Please guide.
> --
> Regards,
> Niranjan Deshpande
>
> "Shut yourself from the world and create the reality you want"
>



-- 
Thanks
Ram