
The documentation for setting up and using Maven is currently split across the main developer documentation page and the Eclipse setup page. This change moves it all into a new page, which will make it easier to add new documentation for Buck in a consistent way. It will also make it a bit easier to remove the Maven documentation later, if/when Maven support is dropped. Also, the documentation for running the acceptance tests in Maven is updated to reflect the changes made in commit fe5f59e, which makes the tests always run in the verify phase unless a specific flag is passed on the command line. Change-Id: I6d8f86127f4ad86fcc10450d18ef0c5a2f0c1424
112 lines
2.2 KiB
Plaintext
112 lines
2.2 KiB
Plaintext
Gerrit Code Review - Building with Maven
|
|
========================================
|
|
|
|
Installation
|
|
------------
|
|
|
|
|
|
Download and install Maven from the
|
|
link:http://maven.apache.org/download.cgi[Apache Maven Project].
|
|
|
|
For detailed instructions for configuring and running Maven, please refer
|
|
to the link:http://maven.apache.org/run-maven/index.html[Maven User Documentation].
|
|
|
|
|
|
[[eclipse]]
|
|
Eclipse Integration
|
|
-------------------
|
|
|
|
|
|
Installing the Maven Integration Plugins
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
In Eclipse version 3.7 (Indigo) and later, these are available in the
|
|
default update site and can be found under the 'Collaboration' category.
|
|
|
|
For older versions the update site must be manually added; the link can
|
|
be found on the http://www.eclipse.org/m2e/download/[m2eclipse download page].
|
|
|
|
Importing Projects
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
Import the projects into Eclipse by going to File -> Import... -> Maven ->
|
|
Existing Maven Projects and selecting the directory containing pom.xml.
|
|
|
|
Some of the source code is generated with ANTLR sources. To build
|
|
these files, right click on the imported projects, Maven -> Update
|
|
Project Configuration. This will resolve compile errors identified
|
|
after import.
|
|
|
|
|
|
[[build]]
|
|
Building on the Command Line
|
|
----------------------------
|
|
|
|
|
|
Gerrit Development WAR File
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
To build the WAR file from the command line:
|
|
|
|
----
|
|
mvn clean package
|
|
----
|
|
|
|
The output executable WAR will be placed in:
|
|
|
|
----
|
|
gerrit-war/target/gerrit-*.war
|
|
----
|
|
|
|
Running Unit Tests
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
By default the build will run the unit tests.
|
|
|
|
To build without tests:
|
|
|
|
----
|
|
mvn clean package -DskipTests
|
|
----
|
|
|
|
[[run-acceptance-tests]]
|
|
Running the Acceptance Tests
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
Acceptance tests are run in the Maven `verify` target:
|
|
|
|
----
|
|
mvn clean verify
|
|
----
|
|
|
|
To build the `verify` target without the acceptance tests:
|
|
|
|
----
|
|
mvn clean verify -Dgerrit.acceptance-tests.skip=true
|
|
----
|
|
|
|
|
|
Documentation
|
|
~~~~~~~~~~~~~
|
|
|
|
|
|
By default the build will generate and include the documentation.
|
|
|
|
To build without documentation:
|
|
|
|
----
|
|
mvn clean package -Dgerrit.documentation.skip
|
|
----
|
|
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|
|
|
|
|