• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How to run "mvn install" from within the ant script?

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I want to run the mvn command from an ant script . my script is as under :


Does only reading the pom.xml mean running the mvn command? I dont know how to approach it . i want to run "mvn install" from within the ant script.
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you want to use <artifact:install ...>. See the docs at:
http://maven.apache.org/ant-tasks/examples/install-deploy.html
 
Arunoday Das Gupta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Peter! But this was not what I was looking for. Anyways I found out the way the mvn can be run as artifact wiht a specific phase (as install, clean etc) by having it as a task in ant script.
 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Arunoday,

Even though the answer you found is to your own question, it's nice to post it. That way, we can all learn something!
 
Arunoday Das Gupta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Greg,

Thanks for mentioning that!

I have implemented the solution by having an artifact of maven in the build.xml

<project name="MyProject" basedir="." default="main" xmlns:artifact="antlib:org.apache.maven.artifact.ant">

<target name="installAll" >
<artifact:mvn>
<arg value="install"/>
</artifact:mvn>
</target>


This way the the install phase of the maven can be called from within the ant script. My purpose was to do some additional functions before running the maven install . For that i had the build.xml but was not sure how to incorporate the maven features


Hope it helps !
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic