You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by pankaj_sahu <pa...@persistent.co.in> on 2008/12/03 15:12:49 UTC

Antrun plugin error

Hi,

 

We want to execute ant pulgin , which should not execute with the default
targets . it should execute when we require it.

I am facing problem with ant plugin. The plugin definition is as follows an
output with different scenarios are as follows:

 

<plugin>

        <groupId>org.apache.maven.plugins</groupId>

        <artifactId>maven-antrun-plugin</artifactId>

        <version>1.2</version>

        <executions>

          <execution>

              <phase>clean</phase>

              <goals>

                <goal>run</goal>

              </goals>

              <configuration>

                <tasks>

                        <echo message="this is a ant script embeded in maven
script"/>

                </tasks>

              </configuration>

          </execution>

        </executions>

      </plugin>

 

 

Output:

Scenario 1: 

 

mvn clean

[INFO] Scanning for projects...

[INFO]
------------------------------------------------------------------------

[INFO] Building jdepend

[INFO]    task-segment: [clean]

[INFO]
------------------------------------------------------------------------

[INFO] [clean:clean]

[INFO] Deleting directory
/home/maven/Bamboo/xml-data/build-dir/GENERAL-JDEPENDREL/build/maven/jdepend
/target

[INFO] Deleting directory
/home/maven/Bamboo/xml-data/build-dir/GENERAL-JDEPENDREL/target/site

[INFO] [antrun:run {execution: default}]

[INFO] Executing tasks

     [echo] this is a ant script embeded in maven script

[INFO] Executed tasks

[INFO]
------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO]
------------------------------------------------------------------------

[INFO] Total time: 2 seconds

[INFO] Finished at: Wed Dec 03 21:17:14 IST 2008

[INFO] Final Memory: 5M/10M

[INFO]
------------------------------------------------------------------------

 

Scenario 2:

 

mvn antrun:run

[INFO] Scanning for projects...

[INFO] Searching repository for plugin with prefix: 'antrun'.

[INFO]
------------------------------------------------------------------------

[INFO] Building jdepend

[INFO]    task-segment: [antrun:run]

[INFO]
------------------------------------------------------------------------

[INFO] [antrun:run]

[INFO] Executing tasks

[INFO] Executed tasks

[INFO]
------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO]
------------------------------------------------------------------------

[INFO] Total time: < 1 second

[INFO] Finished at: Wed Dec 03 21:14:36 IST 2008

[INFO] Final Memory: 2M/5M

[INFO]
------------------------------------------------------------------------

 

The issue is if we execute it with some default targets, it will execute the
tasks at <tasks></tasks> tags, but if we call it directly it won't get
executed. 

Please let me know the possible solution.

 

 

Thanks in advance,

Pankaj


DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.