---
title: "Apache Maven to substitute ant ..."
url: "https://victorfarina.com/blog/apache_maven_to_substitute_ant"
author: "Víctor Fariña"
published: "2004-07-24"
updated: "2004-07-24"
language: "es"
categories: ["tecnología"]
---

# Apache Maven to substitute ant ...

The new tool from Maven takes me a headeache and a few days of configuration and learning about it, but in the end i think its a valuable tool and will be simplify my java developments. You can view my new [JDiary](http://www.wickle.com/projects/jdiary "http://www.wickle.com/projects/jdiary") home generated enterely with maven at the same time that I generate the JNLP to distribute.

**What is Maven:** Maven is a Framework for ant. Its POM (project object model) based and with a couple of files you can build the application, generate test reports, and an entire site for the application.

**Overview:**

All round about one file : _project.xml_ here we define the name of the application, the jars it depends on, where are the CVS, and more information. see sample at the end of the POST. The sencond important file is _project.properties_. It store information about plugins properties for maven (as JNLP, SSH deployment, etc ...) again i post my sample file at the end. The last file is _maven.xml_ (rarely you must modify or create it) but on this case it store ant scripts we need (because maven does not do all ) and goals (on the ant style) to build the application with our own rules.

<!--more-->

**Sample of starting a new application:**

First of all you must download [maven](http://maven.apache.org/start/download.html "http://maven.apache.org/start/download.html") Install it (its very simple) I recomend use [eclipse](http://www.eclipse.org "http://www.eclipse.org") as you IDE , there are a [plugin](http://mevenide.codehaus.org/mevenide-ui-eclipse/ "Mavenide") to eclipse to build maven files. Then you must start using maven (put it on the PATH) with _maven -g_ or _maven genapp_, well read the tutorial [here](http://maven.apache.org/start/index.html "http://maven.apache.org/start/index.html") Some Samples : With _maven jar_ you complie the sources. With _maven site:generate_ you generate the entire site to your application. With _maven site:deploy_ maven will generate a site for your application with download sections, Overview, Documentation, Javadoc, tests , etc ... like on my project [JDiary](http://www.wickle.com/projects/jdiary)

**Problems i found**

There are still very little Documentation .

Very little documentation ...

Its hard to start ( but i recommend to spend 1 or 2 days on this tool)

Some options I put on my xml files are undocumented and i put them using the intuition (such as maven.jnlp.isapplication = true in JNLP plugin) On the other side YOU MUST INSTALL [cvs](https://www.cvshome.org/) to make a _cvs -d:pserver:cvs@yourserver:/cvsroot login_ to initialize the .cvspass on Windows machines. Instead of that you can create a .cvspass on your HOME with a content like this : /1 :pserver:cvs@CVS\_SERVER:2401/usr/local/cvsroot ENCRYPTEDPASSWORD the encrypted password is obtained with _maven changelog:create-cvspass_ Errors associated with this issue: -> Didn 't find password for CVSROOT ':pserver:user@(protected):/repos '. -> org.netbeans.lib.cvsclient.connection.AuthenticationException: Wrong Password. and more ... only for the CHANGELOG plugin

**Sample Files :** Because the tedios labour of pasting XML code on my blog, you must use the [CVS](http://www.wickle.com/horde/cvs/cvs.php/jdiary) repository to see my files.
