You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jmaxwell <je...@gmail.com> on 2006/04/28 19:18:43 UTC

Maven Ant Tasks and Multiple artifacts in one POM

I am currently using the maven ant tasks (and loving it) to build a multiple
module CORBA based application but I have one issue:

When I build I need to generate multiple artifacts:

MyModule-lib.zip (stores ccp libs,corba idls, and includes)
MyModule.jar (java client)
MyModuleHelp.jar (help system)
MyModule-bin.zip (native server binaries)

I would prefer to have one pom per module instead of a pom per each
artifact.

Is this possible using the ant tasks?

Going to (maven) native is not an option at my client (yet).

MAVENIZE!
Jeff


 
--
View this message in context: http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4144455
Sent from the Maven - Users forum at Nabble.com.


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


Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by jmaxwell <je...@gmail.com>.
Dennis,

Actually I am doing that in my parent pom.xml:

<artifact:pom id="maven.project.pom" file="pom.xml" />
<artifact:pom id="maven.java.client.pom" file="java-client-pom.xml" />
<artifact:pom id="maven.lib.pom" file="lib-pom.xml" />
<artifact:pom id="maven.bin.pom" file="bin-pom.xml" />

I just wish that the ant properties that get set in the maven.project.pom
could be referenced in the other poms.

Cheers,

Jeff


Dennis Lundberg-2 wrote:
> 
> jmaxwell wrote:
>> Dan,
>> 
>> I might just cheat and use xslts to create the poms (not pretty).
>> 
>> I hate breaking the DRY (Don't Repeat Yourself) rule.
>> 
>> I do wish that the ant task evaluated ant properties in the poms.
>> At least in this way I could set the value in one place (build.properties
>> or
>> parent pom).
>> 
>> Then you could have a pom similar to this:
>> 
>> <project>
>>  <modelVersion>4.0.0</modelVersion>
>>  <groupId>${mymodule.groupId}</groupId>
>>  <name>${mymodule.name}</name>
>>  <version>${mymodule.version}</version>
>>  <artifactId>${mymodule.version}-lib</artifactId>
>>  <packaging>zip</packaging>
>> </project>
> 
> You could do it the other way around. If you define your pom as a 
> reference in your ant script like this:
>    <artifact:pom id="maven.project" file="pom.xml" />
> 
> Then you can reference the values from it as ant properties like this:
>    <echo>The version is ${maven.project.version}</echo>
> 
>> dan tran wrote:
>>> the alternative ( my be not desirable by you ) is to create one maven
>>> project to call your ant's build which
>>> creates multiple artifacts?
>>>
>>> -Dan
>>>
>>>
>>> On 4/28/06, jmaxwell <je...@gmail.com> wrote:
>>>>
>>>> Dan,
>>>>
>>>> I am using the "Maven 2.0.4 Tasks for Ant".
>>>>
>>>> Cheers,
>>>>
>>>> Jeff
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4147709
>>>> Sent from the Maven - Users forum at Nabble.com.
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>>>
>> 
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4148199
>> Sent from the Maven - Users forum at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>> 
> 
> 
> -- 
> Dennis Lundberg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

--
View this message in context: http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4148489
Sent from the Maven - Users forum at Nabble.com.


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


Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by Dennis Lundberg <de...@apache.org>.
jmaxwell wrote:
> Dan,
> 
> I might just cheat and use xslts to create the poms (not pretty).
> 
> I hate breaking the DRY (Don't Repeat Yourself) rule.
> 
> I do wish that the ant task evaluated ant properties in the poms.
> At least in this way I could set the value in one place (build.properties or
> parent pom).
> 
> Then you could have a pom similar to this:
> 
> <project>
>  <modelVersion>4.0.0</modelVersion>
>  <groupId>${mymodule.groupId}</groupId>
>  <name>${mymodule.name}</name>
>  <version>${mymodule.version}</version>
>  <artifactId>${mymodule.version}-lib</artifactId>
>  <packaging>zip</packaging>
> </project>

You could do it the other way around. If you define your pom as a 
reference in your ant script like this:
   <artifact:pom id="maven.project" file="pom.xml" />

Then you can reference the values from it as ant properties like this:
   <echo>The version is ${maven.project.version}</echo>

> dan tran wrote:
>> the alternative ( my be not desirable by you ) is to create one maven
>> project to call your ant's build which
>> creates multiple artifacts?
>>
>> -Dan
>>
>>
>> On 4/28/06, jmaxwell <je...@gmail.com> wrote:
>>>
>>> Dan,
>>>
>>> I am using the "Maven 2.0.4 Tasks for Ant".
>>>
>>> Cheers,
>>>
>>> Jeff
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4147709
>>> Sent from the Maven - Users forum at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>
> 
> --
> View this message in context: http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4148199
> Sent from the Maven - Users forum at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 


-- 
Dennis Lundberg

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


Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by jmaxwell <je...@gmail.com>.
Dan,

I might just cheat and use xslts to create the poms (not pretty).

I hate breaking the DRY (Don't Repeat Yourself) rule.

I do wish that the ant task evaluated ant properties in the poms.
At least in this way I could set the value in one place (build.properties or
parent pom).

Then you could have a pom similar to this:

<project>
 <modelVersion>4.0.0</modelVersion>
 <groupId>${mymodule.groupId}</groupId>
 <name>${mymodule.name}</name>
 <version>${mymodule.version}</version>
 <artifactId>${mymodule.version}-lib</artifactId>
 <packaging>zip</packaging>
</project>




dan tran wrote:
> 
> the alternative ( my be not desirable by you ) is to create one maven
> project to call your ant's build which
> creates multiple artifacts?
> 
> -Dan
> 
> 
> On 4/28/06, jmaxwell <je...@gmail.com> wrote:
>>
>>
>> Dan,
>>
>> I am using the "Maven 2.0.4 Tasks for Ant".
>>
>> Cheers,
>>
>> Jeff
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4147709
>> Sent from the Maven - Users forum at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

--
View this message in context: http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4148199
Sent from the Maven - Users forum at Nabble.com.


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


Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by dan tran <da...@gmail.com>.
the alternative ( my be not desirable by you ) is to create one maven
project to call your ant's build which
creates multiple artifacts?

-Dan


On 4/28/06, jmaxwell <je...@gmail.com> wrote:
>
>
> Dan,
>
> I am using the "Maven 2.0.4 Tasks for Ant".
>
> Cheers,
>
> Jeff
> --
> View this message in context:
> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4147709
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by jmaxwell <je...@gmail.com>.
Dan,

I am using the "Maven 2.0.4 Tasks for Ant".

Cheers,

Jeff  
--
View this message in context: http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4147709
Sent from the Maven - Users forum at Nabble.com.


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


Re: Maven Ant Tasks and Multiple artifacts in one POM

Posted by dan tran <da...@gmail.com>.
are you talking about maven-ant-plugin?

-D


On 4/28/06, jmaxwell <je...@gmail.com> wrote:
>
>
> I am currently using the maven ant tasks (and loving it) to build a
> multiple
> module CORBA based application but I have one issue:
>
> When I build I need to generate multiple artifacts:
>
> MyModule-lib.zip (stores ccp libs,corba idls, and includes)
> MyModule.jar (java client)
> MyModuleHelp.jar (help system)
> MyModule-bin.zip (native server binaries)
>
> I would prefer to have one pom per module instead of a pom per each
> artifact.
>
> Is this possible using the ant tasks?
>
> Going to (maven) native is not an option at my client (yet).
>
> MAVENIZE!
> Jeff
>
>
>
> --
> View this message in context:
> http://www.nabble.com/Maven-Ant-Tasks-and-Multiple-artifacts-in-one-POM-t1525854.html#a4144455
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>