Hi

I assume that you are using the Maven AntRun Plugin to run the snippet,
but you didn't tell us which version of the plugin you are using.
Different versions of the plugin uses/supports different versions of Ant.

http://maven.apache.org/plugins/maven-antrun-plugin/

On 2010-11-09 19:50, Hahn, Christopher (SAN DIEGO) wrote:
> Hello all,
> 
>  
> 
> I am looking into why an Ant task is failing from Maven, but succeeding
> 
> when called directly using ant.
> 
>  
> 
> We have in a build.xml this block:
> 
> ===============================================
> 
>   <target name="restartora">
> 
>     <exec executable="C:/Windows/system32/net.exe"  failonerror="false">
> 
>       <arg line="stop OracleServiceORCL"/>
> 
>     </exec>
> 
>     <exec executable="C:/Windows/system32/net.exe"  failonerror="true">
> 
>       <arg line="start OracleServiceORCL"/>
> 
>     </exec>
> 
>   </target>
> 
> ===============================================
> 
>  
> 
> I added this target as a dependency to an oracle load target and
> 
> am getting this error:
> 
> ===============================================
> 
> [concat] restartora:
> [concat] [INFO]
> ------------------------------------------------------------------------
> [concat] [ERROR] BUILD ERROR
> [concat] [INFO]
> ------------------------------------------------------------------------
> [concat] [INFO] An Ant BuildException has occured: The following error
> occurred while executing this line:
> [concat] <SNIP>/build.xml:121: Execute failed: java.io.IOException:
> Cannot run program "C:/Windows/system32/net.exe" (in directory
> "<SNIP>"): error=2, No such file or directory
> [concat] [INFO]
> ------------------------------------------------------------------------
> 
> ===============================================
> 
>  
> 
> However, when run from the command line using Ant, I see:
> 
> ===============================================
> 
> D:\<SNIP>d:\ant\apache-ant-1.8.0\bin\ant.bat -f build.xml restartora
> 
> Buildfile: D:\<SNIP>\build.xml
> 
>  
> 
> restartora:
> 
>      [exec] The OracleServiceORCL service is stopping.......
> 
>      [exec] The OracleServiceORCL service was stopped successfully.
> 
>      [exec]
> 
>      [exec] The OracleServiceORCL service is starting....
> 
>      [exec] The OracleServiceORCL service was started successfully.
> 
>      [exec]
> 
>  
> 
> BUILD SUCCESSFUL
> 
> Total time: 30 seconds
> 
> D:\ <SNIP>
> 
> ===============================================
> 
>  
> 
> I fully qualified the references, and so do not think that this is
> 
> an environment issue....(but this is still what I suspect, as my
> 
> Ant might be too-much newer than my Maven)
> 
>  
> 
> I am using:
> 
> ===============================================
> 
> D:\p4\SM\7.10\7.11\server\test\smsetup>set MAVEN_OPTS=-Xmx1024m -Xms128m
> 
> Maven version: 2.0.10
> 
> Java version: 1.5.0_19
> 
> OS name: "windows 2003" version: "5.2" arch: "x86" Family: "windows"
> 
> ===============================================
> 
>  
> 
> Any kicks in the head appreciated,
> 
>  
> 
> Chris
> 
>  
> 
> ------------------------------------------------------------------------
> 
> cid:[email protected]
> 
>       
> 
> *Christopher Hahn*
> The Dude
> 
> Software Production Engineering
> R&D Services, Hewlett-Packard
> Phone: 858-655-4096
> Cell: 619-630-9791
> [email protected] <mailto:[email protected]>
> 
>  
> 
> */Visit our SPE Portal/*
> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
> 
> ------------------------------------------------------------------------
> 
>  
> 
>  
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to