You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by baumar <mb...@active.ch> on 2007/10/25 10:12:02 UTC

using ${pom.version} in assembly.xml

I found a strange effect when using the property  ${pom.version} in an
assembly.xml. Within the <file> element, it is inserted corrected within the
<source>element, but not in <outputDirectory>.

What we try to achieve is to add a directory name containing the version
number in front of the path in the zipfile, because for some tests there are
several versions used in parallel; so instead of /lib we would like to have
/arifactId-version/lib

in concrete

<file>
      <source>target/tavx-${pom.version}.jar</source>
     
<outputDirectory>${pom.artifactId}-${pom.version}/lib</outputDirectory>
</file>

As mentioned, target/tavx-${pom.version}.jar is resolved correctly to
tavx-1.0.jar, the jar just created and added to the zip.
However the path is written literally and turns out in the zip file as

${pom.artifactId}-${pom.version}\lib\tavx-1.0a.jar

I tried other properties like ${user.home} and it worked correctly.

Would there be a restriction that the pom.version must not be used in the
element outputDirectory?

Any idea what this could be or how the pom's version number could be
propagated to the assembly.xml and used as part of a path name?

Thanks for help

Markus
-- 
View this message in context: http://www.nabble.com/using-%24%7Bpom.version%7D-in-assembly.xml-tf4689189s177.html#a13401841
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: using ${pom.version} in assembly.xml

Posted by baumar <mb...@active.ch>.
We found a solution - and maybe a bug? 

We are using windows XP Professional 2002, ServicePack 2

When we write - (as documented in
http://maven.apache.org/guides/introduction/introduction-to-the-pom.html
  <finalName>${pom.artifactId}-${pom.version}</finalName>)



<file>
     <source>target/tavx-${pom.version}.jar</source>
    <outputDirectory>${pom.artifactId}-${pom.version}/lib</outputDirectory>
</file>

then with artifactId=tavx and version=1.0 we found in the winzip file
${pom.artifactId}-${pom.version}/lib/tavx-1.0.jar



Eventually we came to the idea to try 

<file>
     <source>target/tavx-${pom.version}.jar</source>
    <outputDirectory>${POM.artifactId}-${POM.version}/lib</outputDirectory>
</file>

and we get what we want

tavx-1.0/lib/tavx-1.0.jar

I don't love windows, but this looks like a bug in maven. It is particularly
surprising that ${pom.version} can be resolved in the source element, but
not in outputDirectory (if you use
<source>target/tavx-${POM.version}.jar</source>, i.e. POM everywhere the
value is also properly filled in

Cheers

Markus








baumar wrote:
> 
> I found a strange effect when using the property  ${pom.version} in an
> assembly.xml. Within the <file> element, it is inserted corrected within
> the <source>element, but not in <outputDirectory>.
> 
> What we try to achieve is to add a directory name containing the version
> number in front of the path in the zipfile, because for some tests there
> are several versions used in parallel; so instead of /lib we would like to
> have /arifactId-version/lib
> 
> in concrete
> 
> <file>
>       <source>target/tavx-${pom.version}.jar</source>
>      
> <outputDirectory>${pom.artifactId}-${pom.version}/lib</outputDirectory>
> </file>
> 
> As mentioned, target/tavx-${pom.version}.jar is resolved correctly to
> tavx-1.0.jar, the jar just created and added to the zip.
> However the path is written literally and turns out in the zip file as
> 
> ${pom.artifactId}-${pom.version}\lib\tavx-1.0a.jar
> 
> I tried other properties like ${user.home} and it worked correctly.
> 
> Would there be a restriction that the pom.version must not be used in the
> element outputDirectory?
> 
> Any idea what this could be or how the pom's version number could be
> propagated to the assembly.xml and used as part of a path name?
> 
> Thanks for help
> 
> Markus
> 

-- 
View this message in context: http://www.nabble.com/using-%24%7Bpom.version%7D-in-assembly.xml-tf4689189s177.html#a13403020
Sent from the Maven - Users mailing list archive at Nabble.com.


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