File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes maven calling an ant target Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "maven calling an ant target" Watch "maven calling an ant target" New topic
Author

maven calling an ant target

Charles Simms
Greenhorn

Joined: Oct 10, 2008
Posts: 7
I have tried to call an ant target from maven after the install part of the life cycle using eclipse but am having little success. Does anybody have any example they could send.

I have tried to follow the maven example but does not work.
http://maven.apache.org/guides/plugin/guide-ant-plugin-development.html

Cheers
Charlie
Karl Heinz Marbaise
Greenhorn

Joined: Aug 12, 2007
Posts: 19
Hi,
what exactly would you like to reach? Call an Ant Target inside an configured POM ? Or did i misunderstand something ? May be you can give a little output ? Error messages etc. ?
Kind regards
Karl Heinz Marbaise


Software Configuration Management (Subversion, CVS, SVK etc.) http://www.skmwiki.de/
Subversion Repository Search Engine http://www.supose.org/
Charles Simms
Greenhorn

Joined: Oct 10, 2008
Posts: 7
Correct I just want maven to call the ant target “hello” after maven has called install in the life cycle.

I have created a simple plugin, trying to call my ant and mojos script, it is failiing to bind these to my POM and getting the error:

Maven cannot calculate your build plan, given the following information:
Tasks:

- install
Current project:
Group-Id: com.smart421.ppb
Artifact-Id: E-Commerce
Version: 1.0-SNAPSHOT
From file: C:\Projects\E-Commerce\pom.xml
Error message: Mojo: hello does not exist in plugin: org.apache.maven.plugins:maven-plugin-plugin:2.3.
Root error message: Mojo: hello does not exist in plugin: org.apache.maven.plugins:maven-plugin-plugin:2.3

Cheers
Charlie
Charles Simms
Greenhorn

Joined: Oct 10, 2008
Posts: 7
Here is part of my pom file:

<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>hello</id>
<phase>install</phase>
<goals>
</goals>
<configuration><tasks>hello</tasks></configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>

It is not calling my ant target. Where should I put my ant script?

 
 
subject: maven calling an ant target