Difference between revisions of "Maven"

From AardRock Wiki
Jump to navigation Jump to search
(Initial version)
 
(Added more information about installing and fixed some things)
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:


* Make sure Maven is installed on your computer. This is currently not the case at the computers in the BBL.
* Make sure Maven is installed on your computer. This is currently not the case at the computers in the BBL.
** For more information on installing Maven, see http://maven.apache.org/start/install.html
* Checkout https://www.aardrock.com/repos/cheetah/maven to a directory
* 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:
* Edit the settings.xml in your home-directory, and make sure it contains at least this:
Line 12: Line 13:
                         <id>internal-release</id>
                         <id>internal-release</id>
                         <name>Internal Release</name>
                         <name>Internal Release</name>
                         <url>https://cheetah.aardrock.com/maven-repos</url>
                         <url>http://cheetah.aardrock.com/maven-repos</url>
                     </repository>
                     </repository>
                 </repositories>
                 </repositories>
Line 21: Line 22:
         </activeProfiles>
         </activeProfiles>
     </settings>
     </settings>
* Go the the directory you checked out, and do <code>mvn install</code>. Go to the subdirectory of your choice (probably <code>aardrock-cheetah-core</code>), and execute <code>mvn eclipse:eclipse</code>. Now the Eclipse-files will be generated.
* Go the the directory you checked out, and do <code>mvn install</code>. Go to the subdirectory of your choice (probably <code>aardrock-cheetah-core</code>), and execute <code>mvn eclipse:eclipse</code>. Now the Eclipse-files will be generated.
* Create a new (blank) workspace in Eclipse
* Create a new (blank) workspace in Eclipse
Line 34: Line 36:
** Click Finish and start editing!
** Click Finish and start editing!


Note: when you commit your changes, don't commit the generated file in the <code>target</code> directories, and also don't commit the generated files for Eclipse.
== Seeing your changes ==
In Eclipse, you can just run <code>aardrock.cheetah.CheetahCore</code> as a java application.
 
Before you commit your changes, do a <code>mvn test</code>. This will do all Unit Tests in src/test/java. This will also generate output in <code>target/surefire-reports/</code>. 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 <code>target</code> 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 <code>mvn deploy-site</code> and the site will be generated and put online.

Latest revision as of 07:47, 6 June 2006

How to build and work on Cheetah using Maven

   <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.