wiki:PLATFORM_DEPLOYMENT_BUILD_MAVEN

Version 10 (modified by pavlina, 16 years ago) (diff)

--

Platform Deployment Build with Maven

If you don't have Maven installed on your machine yet, use PLATFORM_INFRASTRUCTURE_OVERVIEW

Commands

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:

  • validate: validate the project is correct and all necessary information is available
  • compile: compile the source code of the project
  • test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
  • package: take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test: process and deploy the package if necessary into an environment where integration tests can be run
  • verify: run any checks to verify the package is valid and meets quality criteria
  • install: install the package into the local repository, for use as a dependency in other projects locally
  • deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
  • clean: cleans up artifacts created by prior builds
  • site: generates site documentation for this project

May be you will have 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

Eclipse

You 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.
Note: Do not forget to update Maven dependencies and Update Project Configuration when needed.

Reports

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.
The automatic generated reports are:

  • CPD Report: Duplicate code detection.
  • Checkstyle: Report on coding style conventions.
  • FindBugs Report: Generates a source code report with the FindBugs Library.
  • JavaDocs: JavaDoc API documentation.
  • Maven Surefire Report: Report on the test results of the project.
  • PMD Report: Verification of coding rules.
  • Source Xref: HTML based, cross-reference version of Java source code.

Here is some documentation for these plug-ins: http://shale.apache.org/shale-apps/shale-mailreader/maven-reports.html

The generated reports are in [modulename]/target/site in our repository.