Anchor uses Apache Maven as a build automation tool.
- a build-tool (similar to Ant), and
- repositories for storing versioned artefacts (JARs).
See SonarQube for the repository server that Anchor uses.
There exists a private local maven repository (
$HOME/.m2/ sub-directory in your home-directory) where artifacts may be stored, before being synchronized with the main server.
pom.xmlspecifies build-related settings.
Tutorials on Maven are widely available. Here follows a very brief introduction.
Maven’s build process is centered around https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html.
To perform a build task, simply open a command-shell and change directory to where a pom.xml is located. Then execute maven with a phase as an argument. All necessary prior phases are also executed.
For example, the following command, executes the deploy phase, which builds, installs the binary output in the local maven repository, and then copies the final binaries onto the repository-server.
$ mvn deploy
The following command will only execute only as far as the install phase.
$ mvn install
The following command will delete all binary-files (a different lifecycle).
$ mvn clean
These commands can be executed in the top-level directory (and thus applied to all sub-modules), or for a specific module only in the respective subdirectory.
Download from Apache Maven
.m2/settings.xmlfile as outlined below to access the Anchor repositories.
There is a Maven repository server called Nexus (provides versioned JARs) that is needed to build Anchor.
It is found at:
Currently, this repository requires credentials to access, either to download-from (read) or to deploy-to (write). Contact Owen Feehan to request.
The credentials (username/password) should be specified in your private maven settings, e.g. in
$HOME is the user’s home directory`.
C:\Users\owen\(replace the username).
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd"> <servers> <server> <id>anchor</id> <username>yourusername</username> <password>yourpassword</password> </server> <server> <id>anchor-releases</id> <username>yourusername</username> <password>yourpassword</password> </server> <server> <id>anchor-snapshots</id> <username>yourusername</username> <password>yourpassword</password> </server> <server> <id>anchor-thirdparty</id> <username>yourusername</username> <password>yourpassword</password> </server> </servers> <profiles> <profile> <id>anchorTestConfig</id> <properties> <anchor.home.test>C:\Users\SOMEUSER\Apps\anchor\</anchor.home.test> <anchor.home.deploy>C:\Users\SOMEUSER\Apps\anchor\</anchor.home.deploy> <maven.test.skip>true</maven.test.skip> <maven.javadoc.skip>true</maven.javadoc.skip> </properties> </profile> </profiles> <activeProfiles> <activeProfile>anchorTestConfig</activeProfile> </activeProfiles> </settings>
Replace yourusername and yourpassword appropriately, and update the
anchor.home.deploy variable to match the path where Anchor will be deployed to.
Anchor uses a multi-module setup with a hierarchy of
pom.xml files from the top-level directory to each nested module.
pom.xmlinherits certain settings from the
pom.xmlin its parent-folders.
Each module pom.xml outlines an
version that determine how it is stored in the repository server.
Actually Anchor uses several multi-module projects, each in its own repository.
This is a convenient location for global settings for the build process.
Steps for adding a new plugin module
Based in the root directory of a multi-module respository:
- Create a sub-directory containing the new module in anchor-plugins or anchor-plugins-gpl depending on license.
- Add module name to the
pom.xmlin the root directory of this repository.
- Add a dependency in