Skip to main content

Simple Project Creator command line for Maven2

Posted by edgars on January 18, 2007 at 5:09 PM PST

I've been using Maven 2.x, and I am very happy with their new features. I create a simple but usefeul command line to allow you create project easier.


If you are using Windows, you can create a file called createproject.bat , ant put the following text:

@ echo offecho 
Maven - Create Projects
mvn archetype:create -DgroupId=%1 -DartifactId=%2echo
Project %2 Created sucessfully

Then, you can create in any folder a Maven Project, calling your new command line as the following example:

E:\java\maven2>createproject net.java.dev.greenbox greenbox2

See that %1 is your package, and %2 your project name. Look the output result:

E:\java\maven2>createproject net.java.dev.greenbox greenbox2

Maven - Create Projects[INFO] Scanning for projects...
[INFO]Searching repository for plugin with prefix: 'archetype'.
[INFO]org.apache.maven.plugins: checking for updates from centra
[INFO] org.codehaus.mojo: checking for updates from
centralin-1.0-alpha-3.jar6K downloaded
[INFO] --------------------------------------

I hope it could be as useful for you as it is for me ! After execute this command, you'll can see a Maven2's project structure,
to put you java sources files, in addition a pom.xml file, which will guide you to build really inteligent projects :)