You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Steve Cohen <st...@comcast.net> on 2012/11/28 16:06:57 UTC

assembly plugin - pass property from pom.xml to assembly descriptor

Are properties defined in pom.xml available in the execution of an 
assembly descriptor invoked from pom.xml via the assembly plugin?

If not, is there a way to pass such definitions to the assembly plugin?

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


Re: assembly plugin - pass property from pom.xml to assembly descriptor

Posted by Steve Cohen <sc...@javactivity.org>.
On 11/28/2012 09:27 AM, Thomas Broyer wrote:
> On Wed, Nov 28, 2012 at 4:06 PM, Steve Cohen <st...@comcast.net> wrote:
>> Are properties defined in pom.xml available in the execution of an assembly
>> descriptor invoked from pom.xml via the assembly plugin?
>
> I don't think so (TBH, I didn't even try, because I first saw… see below)
>
>> If not, is there a way to pass such definitions to the assembly plugin?
>
> You can use the maven-resources-plugin to copy and filter the
> descriptor, and point the maven-assembly-plugin at the filtered
> descriptor. This is what Sonatype does when packaging Nexus:
> https://github.com/sonatype/nexus/blob/master/nexus/nexus-oss-webapp/pom.xml
>
> --
> Thomas Broyer
> /tɔ.ma.bʁwa.je/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
>
Actually, to answer my own question, I found that they are.

Given
<properties>
	<mykey>myvalue</mykey>
</properties>

in pom.xml

the assembly descriptor has access to this property via

${project.properties.mykey}



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


Re: assembly plugin - pass property from pom.xml to assembly descriptor

Posted by Thomas Broyer <t....@gmail.com>.
On Wed, Nov 28, 2012 at 4:06 PM, Steve Cohen <st...@comcast.net> wrote:
> Are properties defined in pom.xml available in the execution of an assembly
> descriptor invoked from pom.xml via the assembly plugin?

I don't think so (TBH, I didn't even try, because I first saw… see below)

> If not, is there a way to pass such definitions to the assembly plugin?

You can use the maven-resources-plugin to copy and filter the
descriptor, and point the maven-assembly-plugin at the filtered
descriptor. This is what Sonatype does when packaging Nexus:
https://github.com/sonatype/nexus/blob/master/nexus/nexus-oss-webapp/pom.xml

--
Thomas Broyer
/tɔ.ma.bʁwa.je/

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