Difference between revisions of "Research/Maven"

From AardRock Wiki
Jump to navigation Jump to search
 
 
Line 23: Line 23:
When you want to create a jar from your project, you can do <code>mvn package</code> and a jar will be generated in <code>my-app/target/my-app-1.0-SNAPSHOT.jar</code>.
When you want to create a jar from your project, you can do <code>mvn package</code> and a jar will be generated in <code>my-app/target/my-app-1.0-SNAPSHOT.jar</code>.


I think every developer should at least read chapter 2 of [http://www.mergere.com/m2book_download.jsp Better Build With Maven]
I think every developer should at least read chapter 2 of [http://www.mergere.com/m2book_download.jsp Better Builds With Maven]

Latest revision as of 11:37, 8 May 2006

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