Apache Maven Daemon
APACHE-2.0 License
= mvnd
- the Maven Daemon
:toc: macro
toc::[]
== Introduction
This project aims at providing faster https://maven.apache.org/[Maven] builds using techniques known from Gradle and Takari.
Architecture overview:
mvnd
embeds Maven (so there is no need to install Maven separately).mvnd
client.mvnd
client is a native executable built using https://www.graalvm.org/reference-manual/native-image/[GraalVM].This architecture brings the following advantages:
== Additional features
mvnd
brings the following features on top of the stock Maven:
mvnd
is building your modules in parallel using multiple CPU cores. The number of utilized cores isMath.max(Runtime.getRuntime().availableProcessors() - 1, 1)
. If your source tree does not-T1
into the command line to make your build serial.image::https://user-images.githubusercontent.com/1826249/103917178-94ee4500-510d-11eb-9abb-f52dae58a544.gif[] + Once the build is finished, the complete Maven output is forwarded to the console.
== How to install mvnd
=== Install using https://sdkman.io/[SDKMAN!]
If SDKMAN! supports your operating system, it is as easy as
If you used the manual install in the past, please make sure that the settings in ~/.m2/mvnd.properties
still make
sense. With SDKMAN!, the ~/.m2/mvnd.properties
file is typically not needed at all, because both JAVA_HOME
and
MVND_HOME
are managed by SDKMAN!.
=== Install using https://brew.sh/[Homebrew]
Note: There are two formulae: the mvnd
that install latest, and mvnd@1
that installs 1.x line.
=== Install using https://www.macports.org[MacPorts]
=== Other installers
We're looking for contribution to support https://community.chocolatey.org/packages/mvndaemon/[Chocolatey], https://scoop.sh/[Scoop] or https://github.com/joschi/asdf-mvnd#install[asdf]. If you fancy helping us...
//// === Install using https://www.macports.org[MacPorts]
=== Install using https://community.chocolatey.org/packages/mvndaemon/[Chocolatey]
=== Install using https://scoop.sh/[Scoop]
=== Install using https://github.com/joschi/asdf-mvnd#install[asdf]
////
=== Set up completion
bash
is the only shell supported at this time.
=== Install manually
bin
directory to PATH
~/.m2/mvnd.properties
and set the java.home
property in case you do not want to botherJAVA_HOME
environment variable.mvnd
works:VCRUNTIME140.dll was not found
, you need to installvc_redist.x64.exe
from https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads.== Usage
mvnd
is designed to accept the same command line options like stock mvn
(plus some extras - see below), e.g.:
== mvnd
specific options
--status
lists running daemons
--stop
kills all running daemons
mvnd --help
prints the complete list of options
== Configuration Configuration can be provided through the properties file. Mvnd reads the properties file from the following locations:
MVND_PROPERTIES_PATH
environment variable or mvnd.propertiesPath
system variable[PROJECT_HOME]/.mvn/mvnd.properties
[USER_HOME]/.m2/mvnd.properties
[MVND_HOME]/conf/mvnd.properties
Properties defined in the first files will take precedence over properties specified in a lower ranked file.
A few special properties do not follow the above mechanism:
mvnd.daemonStorage
: this property defines the location where mvnd stores its files (registry and daemon logs). This property can only be defined as a system property on the command linemvnd.id
: this property is used internally to identify the daemon being createdmvnd.extClasspath
: internal option to specify the maven extension classpathmvnd.coreExtensions
: internal option to specify the list of maven extension to registerFor a full list of available properties please see https://github.com/apache/maven-mvnd/blob/master/dist/src/main/distro/conf/mvnd.properties[/dist/src/main/distro/conf/mvnd.properties].
== Build mvnd
from source
=== Prerequisites:
git
JAVA_HOME
to where you unpacked GraalVM in the previous step. Check that java -version
output is asnative-image
tool:native-image
may require additional software to be installed depending on your platform - see the=== Build mvnd
Please note that if you are using Windows as your operating system you will need the following prerequisites for building maven-mvnd
:
a version of Visual Studio with the workload "Desktop development with C++" and the individual component "Windows Universal CRT SDK".
=== Install mvnd
Then you can simply add [target-dir]/bin
to your PATH
and run mvnd
.
We're happy to improve mvnd
, so https://github.com/apache/maven-mvnd/issues[feedback] is most welcome!