You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "KARR, DAVID" <dk...@att.com> on 2012/05/11 00:22:45 UTC

Some questions about customizing the build on the Maven command line

I have a top-level agg pom (call it "level1") that has a module with an agg pom (call it "level2") that specifies several modules.  The directory that agg pom is in has an additional directory (call it "level3") that is not in the modules list, but is also a pom module.  I have a basic idea of how I could specify a command line to run a build in "level2" that would build all the specified modules, and also build "level3".  However, I also have to figure out how I could build a command line in "level1" that when it descends into "level2", will cause "level3" to be built.

What are my options here?

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


Re: Some questions about customizing the build on the Maven command line

Posted by Anders Hammar <an...@hammar.net>.
Just make sure you done deploy this "extra" aggregating pom, or make
sure you use a different artifactId. I strongly suggest not deploying
it as it would be your private special build purposes agg pom. Thus,
don't make it a parent pom.

/Anders

On Fri, May 11, 2012 at 10:30 PM, KARR, DAVID <dk...@att.com> wrote:
>> -----Original Message-----
>> From: GALLAGHER, RON
>> Sent: Friday, May 11, 2012 11:58 AM
>> To: Maven Users List
>> Subject: RE: Some questions about customizing the build on the Maven
>> command line
>>
>> David,
>>
>> Why not just create a new pom file at level1, rather than modifying an
>> existing one?
>>
>> Something like this in pom-david-karr.xml:
>>
>> <project>
>>   <!-- snip -->
>>   <modules>
>>     <module>level2</module>
>>     <module>level2/level3</module>
>>   </modules>
>> </project>
>>
>> Then, you just use the -f command line argument to get Maven to use a
>> different POM file.
>>
>> mvn -f pom-david-karr.xml
>
> Ah.  I had considered creating a custom and separate pom at the level where we had the additional module, but I didn't think of having this at the top level, to specify a module below the level of the first child.  I believe this could work also.
>
>> -----Original Message-----
>> From: KARR, DAVID
>> Sent: Friday, May 11, 2012 11:51 AM
>> To: Maven Users List
>> Subject: RE: Some questions about customizing the build on the Maven
>> command line
>>
>> *** Security Advisory: This Message Originated Outside of AT&T ***.
>> Reference http://cso.att.com/EmailSecurity/IDSP.html for more
>> information.
>>
>> > -----Original Message-----
>> > From: Wayne Fay [mailto:waynefay@gmail.com]
>> > Sent: Friday, May 11, 2012 7:31 AM
>> > To: Maven Users List
>> > Subject: Re: Some questions about customizing the build on the Maven
>> > command line
>> >
>> > >> Why can't you simply make level2 a child (module) of level1, and
>> the
>> > >> same for level3 under level2? Why are you making things harder
>> than
>> > it
>> > >> needs to be?
>> > >
>> > > Because I can't change the poms.
>> >
>> > Then you probably can't make this work. This is a silly and arbitrary
>> > restriction. How would you make this work in Ant if you couldn't
>> > change the build.xml file? Or a similar change with make if you
>> > couldn't change the makefile?
>>
>> It's only silly and arbitrary if you don't know the circumstances.  In
>> this case, it's a reasonable compromise, and I'll leave it at that.
>>
>> I can get this to work by simply having the build script manually run
>> the omitted module in the child module.
>>
>> Thanks anyway.
>>
>> ---------------------------------------------------------------------
>> 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


RE: Some questions about customizing the build on the Maven command line

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: GALLAGHER, RON
> Sent: Friday, May 11, 2012 11:58 AM
> To: Maven Users List
> Subject: RE: Some questions about customizing the build on the Maven
> command line
> 
> David,
> 
> Why not just create a new pom file at level1, rather than modifying an
> existing one?
> 
> Something like this in pom-david-karr.xml:
> 
> <project>
>   <!-- snip -->
>   <modules>
>     <module>level2</module>
>     <module>level2/level3</module>
>   </modules>
> </project>
> 
> Then, you just use the -f command line argument to get Maven to use a
> different POM file.
> 
> mvn -f pom-david-karr.xml

Ah.  I had considered creating a custom and separate pom at the level where we had the additional module, but I didn't think of having this at the top level, to specify a module below the level of the first child.  I believe this could work also.

> -----Original Message-----
> From: KARR, DAVID
> Sent: Friday, May 11, 2012 11:51 AM
> To: Maven Users List
> Subject: RE: Some questions about customizing the build on the Maven
> command line
> 
> *** Security Advisory: This Message Originated Outside of AT&T ***.
> Reference http://cso.att.com/EmailSecurity/IDSP.html for more
> information.
> 
> > -----Original Message-----
> > From: Wayne Fay [mailto:waynefay@gmail.com]
> > Sent: Friday, May 11, 2012 7:31 AM
> > To: Maven Users List
> > Subject: Re: Some questions about customizing the build on the Maven
> > command line
> >
> > >> Why can't you simply make level2 a child (module) of level1, and
> the
> > >> same for level3 under level2? Why are you making things harder
> than
> > it
> > >> needs to be?
> > >
> > > Because I can't change the poms.
> >
> > Then you probably can't make this work. This is a silly and arbitrary
> > restriction. How would you make this work in Ant if you couldn't
> > change the build.xml file? Or a similar change with make if you
> > couldn't change the makefile?
> 
> It's only silly and arbitrary if you don't know the circumstances.  In
> this case, it's a reasonable compromise, and I'll leave it at that.
> 
> I can get this to work by simply having the build script manually run
> the omitted module in the child module.
> 
> Thanks anyway.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org

RE: Some questions about customizing the build on the Maven command line

Posted by "GALLAGHER, RON" <RG...@att.com>.
David,

Why not just create a new pom file at level1, rather than modifying an existing one?

Something like this in pom-david-karr.xml:

<project>
  <!-- snip -->
  <modules>
    <module>level2</module>
    <module>level2/level3</module>
  </modules>
</project>

Then, you just use the -f command line argument to get Maven to use a different POM file.

mvn -f pom-david-karr.xml

Ron Gallagher

-----Original Message-----
From: KARR, DAVID 
Sent: Friday, May 11, 2012 11:51 AM
To: Maven Users List
Subject: RE: Some questions about customizing the build on the Maven command line

*** Security Advisory: This Message Originated Outside of AT&T ***.
Reference http://cso.att.com/EmailSecurity/IDSP.html for more information.

> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Friday, May 11, 2012 7:31 AM
> To: Maven Users List
> Subject: Re: Some questions about customizing the build on the Maven
> command line
> 
> >> Why can't you simply make level2 a child (module) of level1, and the
> >> same for level3 under level2? Why are you making things harder than
> it
> >> needs to be?
> >
> > Because I can't change the poms.
> 
> Then you probably can't make this work. This is a silly and arbitrary
> restriction. How would you make this work in Ant if you couldn't
> change the build.xml file? Or a similar change with make if you
> couldn't change the makefile?

It's only silly and arbitrary if you don't know the circumstances.  In this case, it's a reasonable compromise, and I'll leave it at that.

I can get this to work by simply having the build script manually run the omitted module in the child module.

Thanks anyway.

---------------------------------------------------------------------
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

RE: Some questions about customizing the build on the Maven command line

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Friday, May 11, 2012 7:31 AM
> To: Maven Users List
> Subject: Re: Some questions about customizing the build on the Maven
> command line
> 
> >> Why can't you simply make level2 a child (module) of level1, and the
> >> same for level3 under level2? Why are you making things harder than
> it
> >> needs to be?
> >
> > Because I can't change the poms.
> 
> Then you probably can't make this work. This is a silly and arbitrary
> restriction. How would you make this work in Ant if you couldn't
> change the build.xml file? Or a similar change with make if you
> couldn't change the makefile?

It's only silly and arbitrary if you don't know the circumstances.  In this case, it's a reasonable compromise, and I'll leave it at that.

I can get this to work by simply having the build script manually run the omitted module in the child module.

Thanks anyway.

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

Re: Some questions about customizing the build on the Maven command line

Posted by Wayne Fay <wa...@gmail.com>.
>> Why can't you simply make level2 a child (module) of level1, and the
>> same for level3 under level2? Why are you making things harder than it
>> needs to be?
>
> Because I can't change the poms.

Then you probably can't make this work. This is a silly and arbitrary
restriction. How would you make this work in Ant if you couldn't
change the build.xml file? Or a similar change with make if you
couldn't change the makefile?

Wayne

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


RE: Some questions about customizing the build on the Maven command line

Posted by "KARR, DAVID" <dk...@att.com>.
> -----Original Message-----
> From: Wayne Fay [mailto:waynefay@gmail.com]
> Sent: Thursday, May 10, 2012 7:24 PM
> To: Maven Users List
> Subject: Re: Some questions about customizing the build on the Maven
> command line
> 
> > The directory that agg pom is in has an additional directory (call it
> "level3") that is not in
> > the modules list, but is also a pom module.  I have a basic idea of
> how I could specify a
> > command line to run a build in "level2" that would build all the
> specified modules, and
> > also build "level3".  However, I also have to figure out how I could
> build a command line
> > in "level1" that when it descends into "level2", will cause "level3"
> to be built.
> 
> Why can't you simply make level2 a child (module) of level1, and the
> same for level3 under level2? Why are you making things harder than it
> needs to be?

Because I can't change the poms.

Re: Some questions about customizing the build on the Maven command line

Posted by Wayne Fay <wa...@gmail.com>.
> The directory that agg pom is in has an additional directory (call it "level3") that is not in
> the modules list, but is also a pom module.  I have a basic idea of how I could specify a
> command line to run a build in "level2" that would build all the specified modules, and
> also build "level3".  However, I also have to figure out how I could build a command line
> in "level1" that when it descends into "level2", will cause "level3" to be built.

Why can't you simply make level2 a child (module) of level1, and the
same for level3 under level2? Why are you making things harder than it
needs to be?

Wayne

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