views:

63

answers:

5

I'm working on a mainly Java based project, that also has a couple of components written in C++.

The project is currently built using Ant scripts which invoke Nant to build the C++ components.

We are in the process of moving to Maven and I was wondering if anyone could recommend the best way to build Nant scripts using Maven.

I'm aware that I could just call out to the command line but I was hoping that there might be a more elegant way of doing this.

A: 

The maven antrun plugin allows you to do this for ant. Ideally, something similar exists for nant, however I couldn't find it. Wince the source for the antrun plugin is available, so you should be able to write your own nant plugin.

Keep in mind though, calling out the command line, if it works, is perfectly ok.

Nader Shirazie
A: 

I'm seeing something related, a CI project - "Bamboo" but I'm not familiar with it myself; they are doing stuff with Maven and Nant: http://www.mvnbrowser.com/artifact-details.html?groupId=com.atlassian.bamboo.plugins.nant&artifactId=nant_builder You may be able to make use of their "builder"
Bamboo faq: http://www.atlassian.com/software/bamboo/learn/faq.jsp

Mondain
+1  A: 

I think you can either roll your own, this tutorial is probably a good place to start (can be adapted to call nant rather than msbuild easily enough). Otherwise you may want to look at Mojo, will depend which takes longer to setup I guess.

Jon Freedman
A: 

To my knowledge, there is no Maven NAnt Plugin and your best option if you want to reuse your existing NAnt script would be to call it using the Exec Maven Plugin.

Reference

Pascal Thivent
A: 

As said earlier, if you want to run the exact NAnt script, you will have to resort to something like the Exec Maven Plugin to run NAnt directly.

If you are looking for a more integrated solution for Maven, you might consider NPanday (http://npanday.codeplex.com/)

Brett Porter