You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rusty Wright <ru...@gmail.com> on 2008/11/21 23:07:03 UTC

what filtering does assembly plugin provide?

I'm trying to inject some properties from my pom.xml into a shell script using the assembly plugin.  Is that possible?  Is there some special syntax that I should be using?  In my pom.xml I have

  <profile>
      <id>dev</id>
      <properties>
          <layer>dev</layer>
      etc.

For my assembly descriptor I have

  <assembly>
    <id>deploy-script</id>

    <formats>
        <format>dir</format>
    </formats>

    <includeBaseDirectory>false</includeBaseDirectory>

    <baseDirectory>/</baseDirectory>

    <files>
        <file>
            <source>src/main/scripts/deploy.sh</source>
            <destName>deploy-${pom.layer}.sh</destName>
            <filtered>true</filtered>
            <lineEnding>unix</lineEnding>
        </file>
    </files>
  </assembly>

And the deploy.sh script has at the top

  export REL=${project.version}
  export LAYER=${pom.layer}
  export SVNURL=${pom.developerConnection}

The created script in the target directory is correctly named deploy-dev.sh, and in it the ${project.version} is replaced by the project version, but the 2 ${pom properties aren't.

Am I not using them or specifying them correctly?

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


Re: what filtering does assembly plugin provide?

Posted by Rusty Wright <ru...@gmail.com>.
Thanks; I started seeing through the fog as well.  I don't know where I came up with that ${pom naming scheme.  The scm variable needs project. prepended, so what works is

  export REL=${project.version}
  export LAYER=${layer}
  export SVNURL=${project.scm.developerConnection}

Thanks again!


Olivier Dehon wrote:
> On Fri, 2008-11-21 at 14:07 -0800, Rusty Wright wrote:
>> I'm trying to inject some properties from my pom.xml into a shell script using the assembly plugin.  Is that possible?  Is there some special syntax that I should be using?  In my pom.xml I have
>>
> [snip]
> 
>> And the deploy.sh script has at the top
>>
>>   export REL=${project.version}
>>   export LAYER=${pom.layer}
>>   export SVNURL=${pom.developerConnection}
> 
> I believe you want:
> 
> export LAYER=${layer}
> export SVNURL=${scm.developerConnection}
> 
> (untested)
> 
> -Olivier
> 
> 
> 
> ---------------------------------------------------------------------
> 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: what filtering does assembly plugin provide?

Posted by Olivier Dehon <od...@gmail.com>.
On Fri, 2008-11-21 at 14:07 -0800, Rusty Wright wrote:
> I'm trying to inject some properties from my pom.xml into a shell script using the assembly plugin.  Is that possible?  Is there some special syntax that I should be using?  In my pom.xml I have
> 
[snip]

> And the deploy.sh script has at the top
> 
>   export REL=${project.version}
>   export LAYER=${pom.layer}
>   export SVNURL=${pom.developerConnection}

I believe you want:

export LAYER=${layer}
export SVNURL=${scm.developerConnection}

(untested)

-Olivier



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