Research/Maven

From AardRock Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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