Research/Maven

From AardRock Wiki
Revision as of 11:37, 8 May 2006 by Chris (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Maven is a build-tool. It provides the developers with a simple way of building projects. Once you've built a single Maven-project, you can build them all.

Maven works with targets. One of these targets is compile. For example, you can go to your project directory, and run:

mvn compile

and Maven will compile your project.

A Maven project

A Maven project consists of a directory contain a file called pom.xml and some other directories/files. pom.xml contains the Project Object Model, which describes how your project is set up. Typically, you have a directory layout like this:

my-app
  main
    java
      aardrock
        cheetah
          CheetahCore.java
    test
      aardrock
        cheetah
          CheetahCoreTest.java
  pom.xml   

When you want to create a jar from your project, you can do mvn package and a jar will be generated in my-app/target/my-app-1.0-SNAPSHOT.jar.

I think every developer should at least read chapter 2 of Better Builds With Maven