Difference between revisions of "Maven"

From AardRock Wiki
Jump to navigation Jump to search
Line 43: Line 43:


== How to deploy the site ==
== How to deploy the site ==
When you go to the "aardrock-cheetah-core" module, you can do a "mvn deploy-site" and the site will be generated and put online.
When you go to the "aardrock-cheetah-core" module, you can do a <code>mvn deploy-site</code> and the site will be generated and put online.

Revision as of 13:36, 30 May 2006

How to build and work on Cheetah using Maven

  • Make sure Maven is installed on your computer. This is currently not the case at the computers in the BBL.
  • Checkout https://www.aardrock.com/repos/cheetah/maven to a directory
  • Edit the settings.xml in your home-directory, and make sure it contains at least this:
   <settings>
       <profiles>
           <profile>
               <id>internal</id>
               <repositories>
                   <repository>
                       <id>internal-release</id>
                       <name>Internal Release</name>
                       <url>http://cheetah.aardrock.com/maven-repos</url>
                   </repository>
               </repositories>
           </profile>
       </profiles>
       <activeProfiles>
           <activeProfile>internal</activeProfile>
       </activeProfiles>
   </settings>
  • Go the the directory you checked out, and do mvn install. Go to the subdirectory of your choice (probably aardrock-cheetah-core), and execute mvn eclipse:eclipse. Now the Eclipse-files will be generated.
  • Create a new (blank) workspace in Eclipse
  • Add your m2-repository to the classpath:
    • From the menu bar, select Window > Preferences. Select the Java > Build Path > Classpath Variables page.
    • Click on New, add "M2_REPO" as the name and browse for your path.
      • On windows this is probably C:\Documents and Settings\username\.m2\repository.
      • On Unix this is ~/.m2/repository
  • Finally, import the project in your empty workspace:
    • File > Import
    • Choose "Existing Projects into Workspace", click "Next"
    • Browse for the Root Directory, select the directory "aardrock-cheetah". Here, the project will appear.
    • Click Finish and start editing!

Seeing your changes

In Eclipse, you can just run aardrock.cheetah.CheetahCore as a java application.

Before you commit your changes, do a mvn test. This will do all Unit Tests in src/test/java. This will also generate output in target/surefire-reports/. You can see the XML or the text-file for detailed output.

Important: when you commit your changes, don't commit the generated files in the target directories, and also don't commit the generated files for Eclipse.

How to deploy the site

When you go to the "aardrock-cheetah-core" module, you can do a mvn deploy-site and the site will be generated and put online.