You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Hahn, Christopher (SAN DIEGO)" <ch...@hp.com> on 2010/11/09 19:50:29 UTC

running net start fails from Maven but succeeds from Ant

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:image001.png@01CB7FFA.A6D59D80]

Christopher Hahn
The Dude
Software Production Engineering
R&D Services, Hewlett-Packard
Phone: 858-655-4096
Cell: 619-630-9791
chahn@hp.com<ma...@hp.com>

Visit our SPE Portal<http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>

________________________________




RE: RE: running net start fails from Maven but succeeds from Ant

Posted by "Hahn, Christopher (SAN DIEGO)" <ch...@hp.com>.
Ah, yes, the env is so often the issue (i.e. cron)

I will think about this.

Thank you for taking the time.

Chris

-----Original Message-----
From: Stephen Connolly [mailto:stephen.alan.connolly@gmail.com] 
Sent: Wednesday, November 10, 2010 3:06 PM
To: Maven Developers List
Subject: Re: RE: running net start fails from Maven but succeeds from Ant

Well I've seen differences in the environment that gets passed from maven to
ant versus running ant directly.
.. And to further complicate this, the environment that ant gets is
different again when in a forked maven  eg during release: prepare

- Stephen

---
Sent from my Android phone, so random spelling mistakes are a direct result
of using swype to type on the screen

On 10 Nov 2010 16:49, "Hahn, Christopher (SAN DIEGO)" <
christopher.hahn@hp.com> wrote:

I appreciate the tenacity!

Look earlier in the thread....I have a build.xml that
defined the restartora target.

It runs fine when called from ant on the command line,
but fails when called out in the pom (also pasted in below)

Any clues appreciated.


Chris

-----Original Message-----
From: Dennis Lundberg [mailto:dennisl@apache.org]

Sent: Tuesday, November 09, 2010 10:29 PM
To: Maven Developers List
Subject: Re: running net start f...

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


Re: RE: running net start fails from Maven but succeeds from Ant

Posted by Stephen Connolly <st...@gmail.com>.
Well I've seen differences in the environment that gets passed from maven to
ant versus running ant directly.
.. And to further complicate this, the environment that ant gets is
different again when in a forked maven  eg during release: prepare

- Stephen

---
Sent from my Android phone, so random spelling mistakes are a direct result
of using swype to type on the screen

On 10 Nov 2010 16:49, "Hahn, Christopher (SAN DIEGO)" <
christopher.hahn@hp.com> wrote:

I appreciate the tenacity!

Look earlier in the thread....I have a build.xml that
defined the restartora target.

It runs fine when called from ant on the command line,
but fails when called out in the pom (also pasted in below)

Any clues appreciated.


Chris

-----Original Message-----
From: Dennis Lundberg [mailto:dennisl@apache.org]

Sent: Tuesday, November 09, 2010 10:29 PM
To: Maven Developers List
Subject: Re: running net start f...

RE: running net start fails from Maven but succeeds from Ant

Posted by "Hahn, Christopher (SAN DIEGO)" <ch...@hp.com>.
I appreciate the tenacity!

Look earlier in the thread....I have a build.xml that
defined the restartora target.  

It runs fine when called from ant on the command line,
but fails when called out in the pom (also pasted in below)

Any clues appreciated.

Chris

-----Original Message-----
From: Dennis Lundberg [mailto:dennisl@apache.org] 
Sent: Tuesday, November 09, 2010 10:29 PM
To: Maven Developers List
Subject: Re: running net start fails from Maven but succeeds from Ant

On 2010-11-09 22:58, Hahn, Christopher (SAN DIEGO) wrote:
>  Hello,
> 
> I will discuss upgrading our antrun plugin with my group,
> but some dependencies seem to be up to date....
> 
> Thank you for taking the time.
> 
> Chris
> 
> P.S. Here is the plugin config:

Hmm, I don't see any execution in here that tells us what Ant code you
are invoking. Do you embed the code int the POM or are you referring to
an external build.xml file?

>      <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <version>1.2</version>
>         <dependencies>
>           <dependency>
>             <groupId>ant</groupId>
>             <artifactId>ant-nodeps</artifactId>
>             <version>1.6.5</version>
>           </dependency>
>           <!-- For populating version files Could probably be
>                replaced by xmltask -->
>           <dependency>
>             <groupId>jakarta-regexp</groupId>
>             <artifactId>jakarta-regexp</artifactId>
>             <version>1.4</version>
>           </dependency>
>           <dependency>
>             <groupId>ant</groupId>
>             <artifactId>ant-jakarta-regexp</artifactId>
>             <version>1.6.1</version>
>           </dependency>
>           <dependency>
>             <groupId>com.sun</groupId>
>             <artifactId>tools</artifactId>
>             <version>1.5.0</version>
>             <scope>system</scope>
>             <systemPath>${java.home}/../lib/tools.jar</systemPath>
>           </dependency>
>           <dependency>
>             <!-- For codesigning loop -->
>             <groupId>ant-contrib</groupId>
>             <artifactId>ant-contrib</artifactId>
>             <version>1.0b3</version>
>           </dependency>
>           <dependency>
>             <!-- For xslt task -->
>             <groupId>ant</groupId>
>             <artifactId>ant-trax</artifactId>
>             <version>1.6.5</version>
>           </dependency>
>           <dependency>
>             <!-- For XSLT 2.0 transform in xslt task -->
>             <groupId>net.sf.saxon</groupId>
>             <artifactId>saxon</artifactId>
>             <version>8.7</version>
>           </dependency>
>         </dependencies>
>       </plugin>
> 
> -----Original Message-----
> From: Dennis Lundberg [mailto:dennisl@apache.org] 
> Sent: Tuesday, November 09, 2010 11:49 AM
> To: Maven Developers List
> Subject: Re: running net start fails from Maven but succeeds from Ant
> 
> On 2010-11-09 20:23, Hahn, Christopher (SAN DIEGO) wrote:
>> Hi,
>>
>> Thank you for getting back to me.
>>
>> I am seeing version 1.2 of the plugin.
> 
> This is rather old. The latest version is 1.6. Please try that one.
> 
>> The weird thing is that the ant I used (1.8) was only installed,
>> by me, in order to drive the "ant only" command line test.
>>
>> I could not find an ant install on this box, and am thinking
>> that Maven is using its own plugins to run this within Maven.
> 
> The Maven plugin has its own internal copy of Ant. It doesn't use the
> one that you installed.
> 
>> ....what seems odd to me is that I am using the simplest aspects
>> of this capability.  ...i.e. a straight exec with args.
>>
>> no conditionals or such.
> 
> What does your plugin config look like?
> 
>>
>> Thanks again,
>>
>> Chris
>>
>> -----Original Message-----
>> From: Dennis Lundberg [mailto:dennisl@apache.org] 
>> Sent: Tuesday, November 09, 2010 11:04 AM
>> To: Maven Developers List
>> Subject: Re: running net start fails from Maven but succeeds from Ant
>>
>> 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:image001.png@01CAF080.AD65F1E0
>>>
>>> 	
>>>
>>> *Christopher Hahn*
>>> The Dude
>>>
>>> Software Production Engineering
>>> R&D Services, Hewlett-Packard
>>> Phone: 858-655-4096
>>> Cell: 619-630-9791
>>> chahn@hp.com <ma...@hp.com>
>>>
>>>  
>>>
>>> */Visit our SPE Portal/*
>>> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
>>>
>>> ------------------------------------------------------------------------
>>>
>>>  
>>>
>>>  
>>>
>>
>>
> 
> 


-- 
Dennis Lundberg

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


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


Re: running net start fails from Maven but succeeds from Ant

Posted by Dennis Lundberg <de...@apache.org>.
On 2010-11-09 22:58, Hahn, Christopher (SAN DIEGO) wrote:
>  Hello,
> 
> I will discuss upgrading our antrun plugin with my group,
> but some dependencies seem to be up to date....
> 
> Thank you for taking the time.
> 
> Chris
> 
> P.S. Here is the plugin config:

Hmm, I don't see any execution in here that tells us what Ant code you
are invoking. Do you embed the code int the POM or are you referring to
an external build.xml file?

>      <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-antrun-plugin</artifactId>
>         <version>1.2</version>
>         <dependencies>
>           <dependency>
>             <groupId>ant</groupId>
>             <artifactId>ant-nodeps</artifactId>
>             <version>1.6.5</version>
>           </dependency>
>           <!-- For populating version files Could probably be
>                replaced by xmltask -->
>           <dependency>
>             <groupId>jakarta-regexp</groupId>
>             <artifactId>jakarta-regexp</artifactId>
>             <version>1.4</version>
>           </dependency>
>           <dependency>
>             <groupId>ant</groupId>
>             <artifactId>ant-jakarta-regexp</artifactId>
>             <version>1.6.1</version>
>           </dependency>
>           <dependency>
>             <groupId>com.sun</groupId>
>             <artifactId>tools</artifactId>
>             <version>1.5.0</version>
>             <scope>system</scope>
>             <systemPath>${java.home}/../lib/tools.jar</systemPath>
>           </dependency>
>           <dependency>
>             <!-- For codesigning loop -->
>             <groupId>ant-contrib</groupId>
>             <artifactId>ant-contrib</artifactId>
>             <version>1.0b3</version>
>           </dependency>
>           <dependency>
>             <!-- For xslt task -->
>             <groupId>ant</groupId>
>             <artifactId>ant-trax</artifactId>
>             <version>1.6.5</version>
>           </dependency>
>           <dependency>
>             <!-- For XSLT 2.0 transform in xslt task -->
>             <groupId>net.sf.saxon</groupId>
>             <artifactId>saxon</artifactId>
>             <version>8.7</version>
>           </dependency>
>         </dependencies>
>       </plugin>
> 
> -----Original Message-----
> From: Dennis Lundberg [mailto:dennisl@apache.org] 
> Sent: Tuesday, November 09, 2010 11:49 AM
> To: Maven Developers List
> Subject: Re: running net start fails from Maven but succeeds from Ant
> 
> On 2010-11-09 20:23, Hahn, Christopher (SAN DIEGO) wrote:
>> Hi,
>>
>> Thank you for getting back to me.
>>
>> I am seeing version 1.2 of the plugin.
> 
> This is rather old. The latest version is 1.6. Please try that one.
> 
>> The weird thing is that the ant I used (1.8) was only installed,
>> by me, in order to drive the "ant only" command line test.
>>
>> I could not find an ant install on this box, and am thinking
>> that Maven is using its own plugins to run this within Maven.
> 
> The Maven plugin has its own internal copy of Ant. It doesn't use the
> one that you installed.
> 
>> ....what seems odd to me is that I am using the simplest aspects
>> of this capability.  ...i.e. a straight exec with args.
>>
>> no conditionals or such.
> 
> What does your plugin config look like?
> 
>>
>> Thanks again,
>>
>> Chris
>>
>> -----Original Message-----
>> From: Dennis Lundberg [mailto:dennisl@apache.org] 
>> Sent: Tuesday, November 09, 2010 11:04 AM
>> To: Maven Developers List
>> Subject: Re: running net start fails from Maven but succeeds from Ant
>>
>> 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:image001.png@01CAF080.AD65F1E0
>>>
>>> 	
>>>
>>> *Christopher Hahn*
>>> The Dude
>>>
>>> Software Production Engineering
>>> R&D Services, Hewlett-Packard
>>> Phone: 858-655-4096
>>> Cell: 619-630-9791
>>> chahn@hp.com <ma...@hp.com>
>>>
>>>  
>>>
>>> */Visit our SPE Portal/*
>>> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
>>>
>>> ------------------------------------------------------------------------
>>>
>>>  
>>>
>>>  
>>>
>>
>>
> 
> 


-- 
Dennis Lundberg

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


RE: running net start fails from Maven but succeeds from Ant

Posted by "Hahn, Christopher (SAN DIEGO)" <ch...@hp.com>.
 Hello,

I will discuss upgrading our antrun plugin with my group,
but some dependencies seem to be up to date....

Thank you for taking the time.

Chris

P.S. Here is the plugin config:

     <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.2</version>
        <dependencies>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-nodeps</artifactId>
            <version>1.6.5</version>
          </dependency>
          <!-- For populating version files Could probably be
               replaced by xmltask -->
          <dependency>
            <groupId>jakarta-regexp</groupId>
            <artifactId>jakarta-regexp</artifactId>
            <version>1.4</version>
          </dependency>
          <dependency>
            <groupId>ant</groupId>
            <artifactId>ant-jakarta-regexp</artifactId>
            <version>1.6.1</version>
          </dependency>
          <dependency>
            <groupId>com.sun</groupId>
            <artifactId>tools</artifactId>
            <version>1.5.0</version>
            <scope>system</scope>
            <systemPath>${java.home}/../lib/tools.jar</systemPath>
          </dependency>
          <dependency>
            <!-- For codesigning loop -->
            <groupId>ant-contrib</groupId>
            <artifactId>ant-contrib</artifactId>
            <version>1.0b3</version>
          </dependency>
          <dependency>
            <!-- For xslt task -->
            <groupId>ant</groupId>
            <artifactId>ant-trax</artifactId>
            <version>1.6.5</version>
          </dependency>
          <dependency>
            <!-- For XSLT 2.0 transform in xslt task -->
            <groupId>net.sf.saxon</groupId>
            <artifactId>saxon</artifactId>
            <version>8.7</version>
          </dependency>
        </dependencies>
      </plugin>

-----Original Message-----
From: Dennis Lundberg [mailto:dennisl@apache.org] 
Sent: Tuesday, November 09, 2010 11:49 AM
To: Maven Developers List
Subject: Re: running net start fails from Maven but succeeds from Ant

On 2010-11-09 20:23, Hahn, Christopher (SAN DIEGO) wrote:
> Hi,
> 
> Thank you for getting back to me.
> 
> I am seeing version 1.2 of the plugin.

This is rather old. The latest version is 1.6. Please try that one.

> The weird thing is that the ant I used (1.8) was only installed,
> by me, in order to drive the "ant only" command line test.
> 
> I could not find an ant install on this box, and am thinking
> that Maven is using its own plugins to run this within Maven.

The Maven plugin has its own internal copy of Ant. It doesn't use the
one that you installed.

> ....what seems odd to me is that I am using the simplest aspects
> of this capability.  ...i.e. a straight exec with args.
> 
> no conditionals or such.

What does your plugin config look like?

> 
> Thanks again,
> 
> Chris
> 
> -----Original Message-----
> From: Dennis Lundberg [mailto:dennisl@apache.org] 
> Sent: Tuesday, November 09, 2010 11:04 AM
> To: Maven Developers List
> Subject: Re: running net start fails from Maven but succeeds from Ant
> 
> 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:image001.png@01CAF080.AD65F1E0
>>
>> 	
>>
>> *Christopher Hahn*
>> The Dude
>>
>> Software Production Engineering
>> R&D Services, Hewlett-Packard
>> Phone: 858-655-4096
>> Cell: 619-630-9791
>> chahn@hp.com <ma...@hp.com>
>>
>>  
>>
>> */Visit our SPE Portal/*
>> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
>>
>> ------------------------------------------------------------------------
>>
>>  
>>
>>  
>>
> 
> 


-- 
Dennis Lundberg

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


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


Re: running net start fails from Maven but succeeds from Ant

Posted by Dennis Lundberg <de...@apache.org>.
On 2010-11-09 20:23, Hahn, Christopher (SAN DIEGO) wrote:
> Hi,
> 
> Thank you for getting back to me.
> 
> I am seeing version 1.2 of the plugin.

This is rather old. The latest version is 1.6. Please try that one.

> The weird thing is that the ant I used (1.8) was only installed,
> by me, in order to drive the "ant only" command line test.
> 
> I could not find an ant install on this box, and am thinking
> that Maven is using its own plugins to run this within Maven.

The Maven plugin has its own internal copy of Ant. It doesn't use the
one that you installed.

> ....what seems odd to me is that I am using the simplest aspects
> of this capability.  ...i.e. a straight exec with args.
> 
> no conditionals or such.

What does your plugin config look like?

> 
> Thanks again,
> 
> Chris
> 
> -----Original Message-----
> From: Dennis Lundberg [mailto:dennisl@apache.org] 
> Sent: Tuesday, November 09, 2010 11:04 AM
> To: Maven Developers List
> Subject: Re: running net start fails from Maven but succeeds from Ant
> 
> 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:image001.png@01CAF080.AD65F1E0
>>
>> 	
>>
>> *Christopher Hahn*
>> The Dude
>>
>> Software Production Engineering
>> R&D Services, Hewlett-Packard
>> Phone: 858-655-4096
>> Cell: 619-630-9791
>> chahn@hp.com <ma...@hp.com>
>>
>>  
>>
>> */Visit our SPE Portal/*
>> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
>>
>> ------------------------------------------------------------------------
>>
>>  
>>
>>  
>>
> 
> 


-- 
Dennis Lundberg

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


RE: running net start fails from Maven but succeeds from Ant

Posted by "Hahn, Christopher (SAN DIEGO)" <ch...@hp.com>.
Hi,

Thank you for getting back to me.

I am seeing version 1.2 of the plugin.

The weird thing is that the ant I used (1.8) was only installed,
by me, in order to drive the "ant only" command line test.

I could not find an ant install on this box, and am thinking
that Maven is using its own plugins to run this within Maven.

....what seems odd to me is that I am using the simplest aspects
of this capability.  ...i.e. a straight exec with args.

no conditionals or such.

Thanks again,

Chris

-----Original Message-----
From: Dennis Lundberg [mailto:dennisl@apache.org] 
Sent: Tuesday, November 09, 2010 11:04 AM
To: Maven Developers List
Subject: Re: running net start fails from Maven but succeeds from Ant

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:image001.png@01CAF080.AD65F1E0
> 
> 	
> 
> *Christopher Hahn*
> The Dude
> 
> Software Production Engineering
> R&D Services, Hewlett-Packard
> Phone: 858-655-4096
> Cell: 619-630-9791
> chahn@hp.com <ma...@hp.com>
> 
>  
> 
> */Visit our SPE Portal/*
> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
> 
> ------------------------------------------------------------------------
> 
>  
> 
>  
> 


-- 
Dennis Lundberg

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


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


Re: running net start fails from Maven but succeeds from Ant

Posted by Dennis Lundberg <de...@apache.org>.
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:image001.png@01CAF080.AD65F1E0
> 
> 	
> 
> *Christopher Hahn*
> The Dude
> 
> Software Production Engineering
> R&D Services, Hewlett-Packard
> Phone: 858-655-4096
> Cell: 619-630-9791
> chahn@hp.com <ma...@hp.com>
> 
>  
> 
> */Visit our SPE Portal/*
> <http://teams5.sharepoint.hp.com/teams/SPE/default.aspx>*//*
> 
> ------------------------------------------------------------------------
> 
>  
> 
>  
> 


-- 
Dennis Lundberg

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