Niranjan Deshpande schrieb:
Tim i indeed wht u suggested
<tasks>
<ant antfile..../>
</tasks>
but the build xmls just dont seem to to reached..
It's working for me with this test project:
.
|-- pom.xml
`-- src
`-- main
|-- antscripts
| |-- antscript1.xml
| `-- antscript2.xml
`-- java
relevant snippet from pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>hello-from-ant</id>
<phase>generate-sources</phase>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<tasks>
<ant antfile="src/main/antscripts/antscript1.xml"
target="printhello"/>
<ant antfile="src/main/antscripts/antscript2.xml"
target="printhello"/>
</tasks>
</configuration>
</plugin>
When invoking maven with a phase liek 'mvn package' tha ant tasks get
executed during the spcified 'generate-sources' phase. And when invoking
the antrun-plugin directly via 'mvn antrun:run' the scripts get called, too.
As you see I used the default <configuration/> section outside of the
<execution/>. If you don't need to invoke the ant scripts standalone, I
would move the configuration back inside the defined execution.
-Tim
On Thu, Jun 5, 2008 at 6:53 PM, Tim Kettler <[EMAIL PROTECTED]> wrote:
Hi, (again :-) )
Niranjan Deshpande schrieb:
I am trying to execute ant tasks from maven's pom as below.
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<phase>generate-sources</phase>
<configuration>
<tasks>
<exec executable="AppWeb/src/main/scripts/generate.sh"
failonerror="true">
</exec>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
The generate.sh file has 10 xml files that i want to run as
ant -buildfile -filename
for the time being I am running the plugin as maven antrun:run, just to
find
whether the .sh file is called or not. But i am geting this:
[INFO] [antrun:run]
[INFO] Executing tasks
[INFO] Executed tasks
I have added a ECHO in the .sh file, but i see none at the output
First to answer your concrete problem: When you call a plugin goal directly
from the commandline it uses the common configuration under
<plugin/><configuration/> as there may be more than one execution defined
and there is no sane way to decide which ones configuration to use.
Secondly, just to recap that I understood correctly what you are doing:
You have a maven build from which you want to call a shell script which in
turn triggers a few ant builds?!?
Cant you just configure multiple calls of the <ant/> task [1] in your
antrun-plugin configuration and throw away the shell script completely?
-Tim
[1] http://ant.apache.org/manual/CoreTasks/ant.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]