maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manfred Moser" <manf...@mosabuam.com>
Subject RE: Passing properties to maven POM ran from ant
Date Thu, 07 Jun 2012 17:06:37 GMT
Use env.smx.home


Environment variables are accessible via a prepended env.

On Thu, June 7, 2012 9:30 am, Martin Gainty wrote:
>
> Hi Nicholas I would set an environment variable to smx_home before calling
> mvn e.g.SET smx.home=${smx.home}cmd.exe /c mvn.execmd.exe /c only executes
> the windows binary following /cunless of course if you pass /V:ON   to
> Enable delayed environment variable expansion (where using !var! will
> inplace expand value of var ...analogous to a define macro)
>
> once inside maven... you can echo the environment variable of your
> environment variable smx.home e.g.<plugins>
>     <plugin>       <groupId>org.apache.maven.plugins</groupId>
>       <artifactId>maven-antrun-plugin</artifactId>
>       <executions>
>         <execution>
>           <id>echo</id>
>           <phase>initialize</phase>
>           <goals><goal>run</goal></goals>
>           <configuration>
>             <tasks>
>               <echo>"${smx.home}"</echo>
> ...
>  </tasks></configuration>
> </execution>
> </executions>
> </plugin>
> </plugins>
>
> Bon Chance,
> Martin
> ______________________________________________
> Note de déni et de confidentialité
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la
> copie de ceci est interdite. Ce message sert à l'information seulement et
> n'aura pas n'importe quel effet légalement obligatoire. Étant donné que
> les email peuvent facilement être sujets à la manipulation, nous ne
> pouvons accepter aucune responsabilité pour le contenu fourni.
>
>  > Date: Thu, 7 Jun 2012 04:24:11 -0700
>> From: nicolas.duminil@simplex-software.fr
>> To: users@maven.apache.org
>> Subject: Passing properties to maven POM ran from ant
>>
>> Greetings,
>>
>> I need to execute a mavem pom from an ant script. here is the code of
>> the
>> ant script:
>>
>> <?xml version="1.0"?>
>> <project name="...">
>>   <target name="...">
>> 	  <echo message="smx.home ${smx.home}" />
>>     <exec dir="." executable="cmd">
>>       <arg value="/c"/>
>>       <arg value="mvn"/>
>>       <arg line="scm:bootstrap -Dsmx.home=${smx.home}" />
>>     </exec>
>>   </target>
>> </project>
>>
>> The property smx.home is correctly displayed in the echo task but, as
>> soon
>> in the maven pom it's definition is lost. However, it is defined with
>> -Dsms.home=${smx.home} and, in the maven pom it is referenced as
>> ${smx.home}.
>>
>> Please help.
>>
>> Many thanks in advance.
>>
>> Nicolas
>>
>> --
>> View this message in context:
>> http://maven.40175.n5.nabble.com/Passing-properties-to-maven-POM-ran-from-ant-tp5710940.html
>> 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
>>
>


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


Mime
View raw message