Apache Maven Daemon
= 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].
It starts faster and uses less memory compared to starting a traditional JVM.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 is
given by the formula Math.max(Runtime.getRuntime().availableProcessors() - 1, 1). If your source tree does not
support parallel builds, pass -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: mvnd installs the preview 2.x version (embedding Maven 4.0.x), and mvnd@1 installs the stable 1.x version (embedding Maven 3.9.x).
=== Install using https://www.macports.org[MacPorts]
=== Install using https://aquaproj.github.io/[aqua]
=== 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://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 bother
with setting the JAVA_HOME environment variable.mvnd works:VCRUNTIME140.dll was not found, you need to install
vc_redist.x64.exe from https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads.
See https://github.com/oracle/graal/issues/1762 for more information.
+
If you are on macOS, you'll need to remove the quarantine flags from all the files after unpacking the archive:
[source,shell]== 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.propertiesProperties 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.coreExtensionFilePath: internal option to specify the maven extension configuration file pathFor 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:
gitJAVA_HOME to where you unpacked GraalVM in the previous step. Check that java -version output is as
expected:native-image tool:native-image may require additional software to be installed depending on your platform - see the
https://www.graalvm.org/reference-manual/native-image/#prerequisites[`native-image` documentation].=== 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!
No open issues yet, or sync has not completed.