You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by th...@gmail.com on 2006/04/13 22:26:52 UTC

Overriding Sub-project commands

I have a multi-project build.

>From the top main project I would like to override command in the
sub-projects.

I have a main project, with some sub-projects, in the subproject, I have a
few wars, and jars being built.
In the pom for the sub-project, I tell mvn which directory to build the wars
and jars.
I want to build the wars and jars in a different directory sometimes. Can I
overrride the sub-project command
from the top main project.

Can I do a command line override to change the sub-project output directory?


Thanks

Re: Overriding Sub-project commands

Posted by th...@gmail.com.
Thanks, that did work, but the correct tags would be:
In the sub-project pom.

<build>

<pluginManagement>

<plugins>

<plugin>

<artifactId>maven-war-plugin</artifactId>

<configuration>

<outputDirectory>${war.dir}</outputDirectory>

</configuration>

</plugin>

</plugins>

</pluginManagement>

</build>



On 4/13/06, Wayne Fay <wa...@gmail.com> wrote:
>
> You could perhaps utilize profiles for this? Or properties in your top
> project pom.xml?
>
> <properties>
> <jar.dir>/tmp/jar</jar.dir>
> <war.dir>/tmp/war</war.dir>
> </properties>
>
> Then in subproject:
> jar/pom.xml
> <build>
> <outputDirectory>${jar.dir}</outputDirectory>
>
> I haven't tested this, just an idea. You could possibly set the
> properties on the command line too with -Djar.dir=/tmp/jar etc...
>
> Wayne
>
> On 4/13/06, thenew05@gmail.com <th...@gmail.com> wrote:
> > I have a multi-project build.
> >
> > From the top main project I would like to override command in the
> > sub-projects.
> >
> > I have a main project, with some sub-projects, in the subproject, I have
> a
> > few wars, and jars being built.
> > In the pom for the sub-project, I tell mvn which directory to build the
> wars
> > and jars.
> > I want to build the wars and jars in a different directory sometimes.
> Can I
> > overrride the sub-project command
> > from the top main project.
> >
> > Can I do a command line override to change the sub-project output
> directory?
> >
> >
> > Thanks
> >
> >
>

Re: Overriding Sub-project commands

Posted by Wayne Fay <wa...@gmail.com>.
You could perhaps utilize profiles for this? Or properties in your top
project pom.xml?

<properties>
<jar.dir>/tmp/jar</jar.dir>
<war.dir>/tmp/war</war.dir>
</properties>

Then in subproject:
jar/pom.xml
<build>
<outputDirectory>${jar.dir}</outputDirectory>

I haven't tested this, just an idea. You could possibly set the
properties on the command line too with -Djar.dir=/tmp/jar etc...

Wayne

On 4/13/06, thenew05@gmail.com <th...@gmail.com> wrote:
> I have a multi-project build.
>
> From the top main project I would like to override command in the
> sub-projects.
>
> I have a main project, with some sub-projects, in the subproject, I have a
> few wars, and jars being built.
> In the pom for the sub-project, I tell mvn which directory to build the wars
> and jars.
> I want to build the wars and jars in a different directory sometimes. Can I
> overrride the sub-project command
> from the top main project.
>
> Can I do a command line override to change the sub-project output directory?
>
>
> Thanks
>
>