Changes between Version 15 and Version 16 of PLATFORM_DEPLOYMENT_BUILD_MAVEN


Ignore:
Timestamp:
01/14/09 14:02:07 (16 years ago)
Author:
pav
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PLATFORM_DEPLOYMENT_BUILD_MAVEN

    v15 v16  
    22If you don't have Maven installed on your machine yet, use [wiki:PLATFORM_INFRASTRUCTURE_OVERVIEW#MavenIntegration][[BR]] 
    33== Commands == 
    4 The syntax for running Maven commands is mvn [command]. They have to be executed in the console in sophie2-platform (in the repository) directory or in the module you want to command (again in its directory). The basic of them are: 
     4The syntax for running Maven commands is mvn [profile] [command] [parameters]. They have to be executed in the console in sophie2-platform (in the repository) directory or in the module you want to command (again in its directory). The basic of them are: 
    55 * validate: validate the project is correct and all necessary information is available 
    66 * compile: compile the source code of the project 
     
    1313 * clean: cleans up artifacts created by prior builds 
    1414 * site: generates site documentation for this project 
    15 Maybe you will have memory problems executing some of the commands for example mvn site. One of the solutions is to set your MAVEN_OPTS variable to -Xmx1024m -XX:MaxPermSize=256m -Xss16m 
     15If you want to skip the tests in the project while building and don't need their results(or the resulted test reports), add '-Dmaven.test.skip=true' in the end of the command you execute. 
     16 
     17Maven 2 introduces the concept of a build profile. Profiles are specified using a subset of the elements available in the POM itself (plus one extra section), and are triggered in any of a variety of ways. They modify the POM at build time, and are meant to be used in complementary sets to give equivalent-but-different parameters for a set of target environments. We have two profile sections defined in our project and they are: 
     18  * hudson profile - used for hudson build server (sophie2.org:8080) to generate various reports and their needed maven goals(on this time only the cobertura report is generated using this profile) 
     19 * jspcompile - used for compiling the jsp, used by Sophie 2 server. The command is 'mvn -Djspcompile [maven-goal]' -Dmaven.test.skip=true. See [wiki:S2S_TESTING_SERVER_R0] for more information.  
     20 
     21Note: Maybe you will have memory problems executing some of the commands for example mvn site. One of the solutions is to set the MAVEN_OPTS variable to  -Xmx1024m -XX:MaxPermSize=386m -Xss16m 
    1622 == Eclipse == 
    1723You can execute Maven commands over the project in Eclipse right-clicking on the pom.xml file in the parent project or in the module you want to command. Select Run As and choose the desired command. [[BR]] 
     24There is 'Maven build...' option where you can add the goals, profiles and parameters you want to execute with 'mvn' command.[[BR]] 
    1825Note: Do not forget to update Maven dependencies and Update Project Configuration when needed. 
    1926 
    2027== Reports == 
    21 To generate the reports you want you should add the report plug-ins you need into the reporting section at the end of the pom.xml file. [[BR]] 
     28To generate the reports you want you should add the report plug-ins you need into the reporting section at the end of the pom.xml file.  
     29For example this code in the base pom.xml installs the maven-javadoc-plugin and generate javadoc reports using the variables in the configuration section while executing 'mvn site' command: 
     30{{{ 
     31<plugin> 
     32        <groupId>org.apache.maven.plugins</groupId> 
     33        <artifactId>maven-javadoc-plugin</artifactId> 
     34           <configuration> 
     35                <sourcepath>${basedir}/src/main/java</sourcepath> 
     36                <javadocVersion>1.5</javadocVersion> 
     37                <fork>true</fork> 
     38                <failOnError>false</failOnError>                                         
     39        </configuration> 
     40   </plugin>  
     41}}} 
     42 
     43See http://docs.codehaus.org/display/MAVENUSER/Reporting+Plugins to get into. 
     44 
    2245The automatic generated reports are: 
    2346 * CPD Report:  Duplicate code detection.