Skip to content

1. Maven

Hilario Fernandes edited this page Nov 6, 2017 · 7 revisions

Apache Maven is the project management and build tool used by Hitachi Vantara. Any new project should be created using this tool and extend the Pentaho parent poms unless there is a clear justification not to do so.

Installation and Setup

Browse to https://maven.apache.org/download.cgi and download and install the latest Maven binary for your platform.

WARNING! As of MAR 1st, 2016, the build machines are using version 3.3.3 of Maven. If you want to play it safe, you may want to specifically install that version. However, if the buildteam finds, or is notified of, a bugfix or feature enhancement, they may move to a more recent version without notice. Ask if in doubt.

After Maven has been installed. Issue the following at a command line:

mvn initialize

This should respond with something similar to the following:

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [initialize]
[INFO] ------------------------------------------------------------------------
[INFO] No goals needed for project - skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Tue Mar 01 12:30:50 EST 2016
[INFO] Final Memory: 2M/30M
[INFO] ------------------------------------------------------------------------

That unto itself is not particularly interesting. However, this command should have created a directory named .m2 in your home directory. This directory will contain the local repository that Maven will download and install artifacts to. Local builds will check this repository first for release versions of artifacts before attempting to download them from remote repositories.

By default, Maven will attempt to use “Maven Central” to resolve all artifacts. A clear sign that your builds are using Maven Central as the remote repository is if you see downloads initiated from https://repo.maven.apache.org/maven2

Pentaho does not release artifacts to Maven Central. Therefore, anyone wanting to build a Pentaho Maven project will need to add a reference to our repository to their Maven config. The Maven config file is called settings.xml. We have two recommended base configurations, depending on whether you are an active contributor or whether you just want to resolve Pentaho artifacts for your our custom plugins and such.

Recommended Configuration

If you are an active contributing developer, you should copy this settings.xml to your ~/.m2 folder.