0

I wrote a project which use maven. It's good for me.
But, some other people don't have maven, so I am trying to write an ant build.xml for them.

My question is:

Inside "javac" -> "classpath" tag, how could ant get the libs I used in the project from maven? So that could compile & pack all the 3rd-party libs into release via ant.

Is this possible or there are better solution for maven & ant exists in same project.

Eric
  • 22,183
  • 20
  • 145
  • 196
  • See: http://stackoverflow.com/questions/10944349/is-it-possible-to-refer-to-a-classpath-defined-in-one-build-file-from-another-bu/10957899#10957899 and for more detailed ivy usage example, see: http://stackoverflow.com/questions/15979391/class-not-found-with-ant-ivy-and-junit-error-in-build-xml/15982144#15982144 – Mark O'Connor Jan 05 '15 at 22:01

2 Answers2

2

Ant combined with Ivy is your answer. Ant can use a Maven repository to pull in jars, and can even be made to output a pom.xml, so the jar can be deployed back to a Maven repository.

I have an ivy.dir project on Github that I use to help integrate Ivy into already existing Ant tasks -- especially if they use Subversion as a version control system. You can create a ivy.dir subproject, and make that an external on the Ant project.

David W.
  • 105,218
  • 39
  • 216
  • 337
1

Have a look at ivy. Use it to download your dependencies for ant from a maven repository.

Cfx
  • 2,272
  • 2
  • 15
  • 21
  • I already use ivy in my project, it convert a pom.xml to ivy.xml first, then download jars via ivy.xml, really a good tool! – Eric Jan 07 '15 at 05:46