Hi all,
I've just joined this mailing list, so sorry for not answering to the
proper thread, I just red on the archives that you were discussing about
maven.

I'm very interested in machine learning. I'm a skilled Java developer, I
know what a neural network is and how a map-reduce algorithm works, but
unfortunately I didn't took a course at university to properly handle
all the math that is often involved in these algorithms. But I have
quite an experience with Maven, both as an "end user", as a "power user"
and as a developer, so if you feel like I can help, it would be a pleasure.

I'm a Cocoon committer, in Cocoon we have adopted maven 2 as a build
system, it has been hard to MIGRATE all the Cocoon code to the new
structure of a Maven 2 build, also because Cocoon has an impressive
amount of code and dependencies.

After the Cocoon experience, I've started using Maven 2 as my default
build system in my company and even for every personal and small code
snippet I write, and I'm really in love with it.

Just to save you the pain, I will give you a short introduction on how
Maven 2 works and the benefits a project like this could gain using it :

The standard basic structure of a maven project is as follows :

project-name
   src
      main
          java
          resources
          <other language>
      test
          java
          resources
          <other language or test suite>

This standardized structure is completed with an XML file, called
pom.xml. This file contains mainly 3 parts :
- Identify the artifact : group-id (org.apache.lucene.mahout for
example), artifact-id (common, alorithm-a etc..), version
- State the dependencies : some algorithms could depend on other
algorithms, depend on common, depend on other libraries.
- Configure additonals "plug-ins" (called Mojos in Maven terminology)
used during the build process : there are many available mojos to do a
lot of stuff.

Once the pom file is in place, and the sources are placed in the right
folders, using maven is extremely simple :

mvn install

Will do the following :
- Resolve all the dependencies, even transitively (like this-project
depends on library-a, library-a depends on library-b and so on)
- Resolve version conflicts between dependencies
- Download jars for all the dependencies from the public repositories
(see http://repo1.maven.org/maven2/ to see how many libraries are
already there)
- Build all the sources in src/main/java
- Add the resources in src/main/resources
- Build all the sources in src/test/java
- Add the resources in src/test/resources
- Run the tests (it supports JUnit and a bunch of other test systems)
- Package classes from src/main/java and resources from
src/main/resources in the artifact own jar

Once proper settings and mojos are in place in the pom.xml, a simple :

mvn deploy

will run all the steps of mvn install, plus deploy the jar with all its
meta-data to a repository, from which it can be eventually moved to the
public repository.

Another great advantage of Maven is how easy it is to USE a library
deployed on Maven public repositories.

Suppose my project wants to use a map-reduce algorithm from this
project, I just have to write inside the pom.xml file of my project :

<dependency>
    <groupId> org.apache.lucene.mahout</groupId>
    <artifactId>map-reduce-algo-a</artifactId>
    <version>1.0.3</version>
</dependency>

And the correct jar, and all its dependencies, will be in my classpath,
ready to be used by my application.

Also, Maven is supported widely : there are many continuous integration
tools that supports Maven, there are Eclipse plugins for Maven and so on.

I'm not saying that Maven is necessarily painless, as every software it
has its own bugs, weak areas and some voodoo here and there, but in my
experience it has proved to be a reliable, sophisticated and at the same
time easy to use build system, it's Apache, it's Java based and it's
easily customizable and expandable.

Hope this helps,
Simone

-- 
Simone Gianni

Reply via email to