I believe you need to declare a property in the pom:
<properties>
<SVN_REVISION>${env.SVN_REVISION}</SVN_REVISION>
</properties>
your can test it by passing on the command line:
mvn -DSVN_REVISION=$SVN_REVISION ...
/r
At 9:36 PM -0400 8/2/10, Pulkit Singhal wrote:
>I followed your advise and setup something like the following:
>
> <resources>
> <resource>
>
> <targetPath>${project.build.directory}/${project.artifactId}-${project.version}/test</targetPath>
> <filtering>true</filtering>
> <directory>${basedir}/src/main/resources</directory>
> <includes><include>version.xml</include></includes>
> </resource>
> </resources>
>
>and
>
><?xml version="1.0" encoding="UTF-8"?>
><root>
> <buildNumber>${BUILD_NUMBER}</buildNumber>
> <svnRevisionNumber>${SVN_REVISION}</svnRevisionNumber>
></root>
>
>But I get back the version.xml file as-is without any substitution in
>the target test folder.
>
>Any suggestions?
>- Pulkit
>
>On Mon, Aug 2, 2010 at 8:00 PM, Russ Tremain <[email protected]> wrote:
>> during the process-resources phase of the build lifecycle [1], you can
>> substitute values.
>>
>> see: http://maven.apache.org/ref/2.2.1/maven-model/maven.html#class_resource
>>
>> you would need to enable filtering.
>>
>> refs:
>> [1]
>> http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
>>
>> At 7:09 PM -0400 8/2/10, Pulkit Singhal wrote:
>>>I know that what you suggested is a perfectly acceptable solution ...
>>>but I cringe at the thought of running ant in maven ... no real reason
>>>to do so ... it is just unappealing to me somehow. And I find it just
>>>a bit odd that I can't write out or echo variables to a file. Doesn't
>>>maven have any controls for that at all?
>>>
>>>On Mon, Aug 2, 2010 at 6:32 PM, a.geo <[email protected]> wrote:
>>>> maybe with a Ant task
>>>> Look at the Replace task documentation
>>>> http://www.jajakarta.org/ant/ant-1.6.1/docs/en/manual/CoreTasks/replace.html
>>>>
>>>> You need first, make a copy from a template with a Copy task, and next use
>>>> the replace task to replace the token with the new value, the current
>>>> version... : D
>>>>
>>>> 2010/8/2 Pulkit Singhal <[email protected]>
>>>>
>>>>> Does anyone know how to write out to a file from inside a pom.xml file?
>>>>>
>>>>> I ask because I want to put my hudson build's ${SVN_REVISION} value
>>>>> into a version.txt file.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> - Pulkit
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: [email protected]
>>>>> For additional commands, e-mail: [email protected]
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Cesar De la Cruz Rojas
>>>> *
>>>> -----------------------------------------------------------------------------
>>>> *
>>>> Sennior Software Engineer
>>>> -----------------------------------------------------------------------------
>>>> Follow me in Facebook : http://www.facebook.com/aquiles.geo
>>>> Twitter http://twitter.com/ageo
>>>> Picture blog http://ageo.deviantart.com
>>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: [email protected]
>>>For additional commands, e-mail: [email protected]
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]