I have a ant build.xml file , how can i directly create a maven pom.xml which is exactly equivalent of build.xml file ? I know that I can create a maven project and move the folder of build.xml to appropriate folder of maven directories, But is there any automated way of doing this ?
-
You can check de antrun plugin https://maven.apache.org/plugins/maven-antrun-plugin/ – jjlema Jan 04 '16 at 11:08
2 Answers
ANT and MAVEN are different so there is probably no such complete automation really. Still there are some attempts to automate it (see: https://github.com/ewhauser/ant2maven/blob/master/ant2maven.groovy and its forked repositories). Another approach may be to create a pom.xml file and use https://maven.apache.org/plugins/maven-antrun-plugin/ to include the ANT script in it.

- 6,272
- 1
- 28
- 34
The simple answer is no. There is no easy way to generate a POM.
In my opinion switching to Maven is best left to new projects with little or no legacy to defend. In short Maven is a highly opinionated build tool that follows a standardized build workflow. ANT, on the other, ANT is gloriously configurable... resulting in no two builds working the same way :-)
A secondary problem is that few ANT builds properly record the origin and version of their 3rd party dependencies...
In most cases you are better off keeping the existing ANT build logic and introduce dependency managment using a plugin like Apache ivy. This allows an ANT project to properly integrate with a Maven repository infrastructure. This further enables collaboration with other teams using alternative build tools like Maven, Gradle or SBT.
Related answers:

- 1
- 1

- 76,015
- 10
- 139
- 185