You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by jiapei100 <jp...@gmail.com> on 2011/06/08 10:06:20 UTC

How to convert from Ant project to maven project?

Hi, all:

Sorry for my entry-level question. Is it possible for me to convert from an
Ant project to A Maven project from within NetBeans IDE?

Or, is there any method to convert from an Ant project to a Maven project
using some command line method? Or, any standard method to do so?

Best Regards
Pei

--
View this message in context: http://maven.40175.n5.nabble.com/How-to-convert-from-Ant-project-to-maven-project-tp4468638p4468638.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to convert from Ant project to maven project?

Posted by Wayne Fay <wa...@gmail.com>.
> Sorry for my entry-level question. Is it possible for me to convert from an
> Ant project to A Maven project from within NetBeans IDE?

This is a question for the Netbeans User list.

> Or, is there any method to convert from an Ant project to a Maven project
> using some command line method?

Not that I am aware of.

> Or, any standard method to do so?

As Stephen already told you, the easiest option is probably to create
an empty Maven project structure and then move your source code and
resources to the proper directories. But this assumes that you have a
fairly simple project. If you are doing anything "special" then this
will most likely not work either.

Your best bet is to start reading about Maven using one of the free
ebooks that are available and linked to from the
http://maven.apache.org website, create some sample projects as
outlined in those books, begin to understand the tool and how it
works, and then attempt to convert an Ant build. You can't skip all
that learning and expect to be successful in this endeavor.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to convert from Ant project to maven project?

Posted by Stephen Connolly <st...@gmail.com>.
1. Maven is not ANT. I assume you have read the Maven books and have
tried some projects using Maven. If you are somebody who is used to
ANT it will take a while to de-ANT you, so switching an ANT based
project over to Maven is a really bad way to learn Maven... OTOH

2. If you have a fairly simple project structure (ie you just are
building a jar or a war and not doing fancy stuff) the best bet is to
create an empty Maven project structure (one module for each jar and
one module for each web app... if you have more than one module create
a parent project to hold them all)

Then just move the .java files into (module)/src/main/java/ and all
the resources into (module)/src/main/resources/ keeping the existing
package directory structure... Then repeat the same for any tests you
have, .java files into (module)/src/test/java/ and all the resources
into (module)/src/test/resources/ All the webapp files go into
(module)/src/main/webapp in the layout as for the war, so e.g. the
web.xml goes to (module)/src/main/webapp/WEB-INF/web.xml

Next you add all the dependencies to the poms, and cross your fingers
and do "mvn verify" if that works you are done with ANT and on to
Maven.

3. If you have a complex project try to do a migration along the lines
of #1 first.

On 8 June 2011 09:06, jiapei100 <jp...@gmail.com> wrote:
>
> Hi, all:
>
> Sorry for my entry-level question. Is it possible for me to convert from an
> Ant project to A Maven project from within NetBeans IDE?
>
> Or, is there any method to convert from an Ant project to a Maven project
> using some command line method? Or, any standard method to do so?
>
> Best Regards
> Pei
>
> --
> View this message in context: http://maven.40175.n5.nabble.com/How-to-convert-from-Ant-project-to-maven-project-tp4468638p4468638.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org