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: [email protected]
> To: [email protected]
> 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: [email protected]
> For additional commands, e-mail: [email protected]
> 
                                          

Reply via email to