Anchor uses Apache Maven as a build automation tool.
- a build-tool (similar to Ant), and
- repositories for storing versioned artefacts (JARs).
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 repository server for packages.
pom.xmlspecifies build-related settings.
Maven’s configuration combines many plugins, and some key third-party libraries are integrated via this mechanism into Anchor’s build process.
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.
The project uses GitHub Packages as a repository serve (provides versioned JARs) that is needed to build Anchor.
It is found at:
ANCHOR-REPOSITORY-NAME should be substituted with the respect repository name e.g.
This repository requires a token from GitHub to read from (and requires credentials from Owen Feehan to write to).
The credentials (username/token) 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>github</id> <username>YOUR_USERNAME</username> <password>YOUR_TOKEN</password> </server> <server> <id>path-pattern-finder</id> <username>YOUR_USERNAME</username> <password>YOUR_TOKEN</password> </server> </servers> <profiles> <profile> <id>anchorTestConfig</id> <properties> <anchor.home.test>C:\SOMEDIRECTORY\Apps\anchor\</anchor.home.test> <anchor.home.deploy>C:\SOMEDIRECTORY\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>
YOUR_TOKEN 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