Okay here is some more update. I called the simple bat file returning 0
and 1 via exec-maven-plugin and then maven build failed/passed
accordingly.

So it means that ant script is not returning proper
error code to exec-maven-plugin So next question arises that can we
force ant to return error code when ant script fails :-)

Thanks,

Petr

--- On Fri, 10/31/08, Petr V. <[EMAIL PROTECTED]> wrote:
From: Petr V. <[EMAIL PROTECTED]>
Subject: [mojo-user] exec-maven-plugin Exit Code Issue
To: [email protected]
Date: Friday, October 31, 2008, 10:56 PM

>From my maven pom file , I am trying to call some other script(let's assume it 
>is an ant script for sake of discussion) which fails but my maven build 
>process goes on. I want my maven build to fail if it calls some external 
>script which fails. I looked at documentation of plugin but I dont see any 
>option that would help me setting up what to do when my called program or 
>script via exec-maven-plugin fails

  <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1</version>
        <executions>
         
 <execution>
            <id>dowithant</id>
            <configuration>
              <executable>ant</executable>
            </configuration>
              <phase>compile</phase>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>        
 
        </executions>
 </plugin>

It calls my ant script which fails but iot goes on with my maven build :-(.

Is there any way I can catch the failure of external script ?

Thanks,

Petr








      


      

Reply via email to