apache / maven-mvnd

Apache Maven Daemon
https://maven.apache.org/
Apache License 2.0
2.9k stars 207 forks source link
apache-maven build-management java maven

= mvnd - the Maven Daemon :toc: macro

image::https://img.shields.io/twitter/url/https/twitter.com/mvndaemon.svg?style=social&label=Follow%20%40mvndaemon[link="https://twitter.com/mvndaemon"]

toc::[]

== Introduction

This project aims at providing faster https://maven.apache.org/[Maven] builds using techniques known from Gradle and Takari.

Architecture overview:

This architecture brings the following advantages:

== Additional features

mvnd brings the following features on top of the stock Maven:

== How to install mvnd

=== Install using https://sdkman.io/[SDKMAN!]

If SDKMAN! supports your operating system, it is as easy as

[source,shell]

sdk install mvnd

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]

[source,shell]

brew install mvndaemon/homebrew-mvnd/mvnd

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]

[source,shell]

sudo port install mvnd

=== 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]

[source,shell]

$ sudo port install mvnd

=== Install using https://community.chocolatey.org/packages/mvndaemon/[Chocolatey]

[source,shell]

$ choco install mvndaemon

=== Install using https://scoop.sh/[Scoop]

[source,shell]

$ scoop install mvndaemon

=== Install using https://github.com/joschi/asdf-mvnd#install[asdf]

[source,shell]

$ asdf plugin-add mvnd $ asdf install mvnd latest

////

=== Set up completion

Optionally, you can set up completion as follows: [source,shell]

ensure that MVND_HOME points to your mvnd distribution, note that sdkman does it for you

$ echo 'source $MVND_HOME/bin/mvnd-bash-completion.bash' >> ~/.bashrc

bash is the only shell supported at this time.

=== Install manually

== Usage

mvnd is designed to accept the same command line options like stock mvn (plus some extras - see below), e.g.:

[source,shell]

mvnd verify

== 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:

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:

For 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:

=== Build mvnd

[source,shell]

$ git clone https://github.com/apache/maven-mvnd.git $ cd maven-mvnd $ mvn clean verify -Pnative ... $ cd client $ file target/mvnd target/mvnd: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=93a554f3807550a13c986d2af9a311ef299bdc5a, for GNU/Linux 3.2.0, with debug_info, not stripped $ ls -lh target/mvnd -rwxrwxr-x. 1 ppalaga ppalaga 25M Jun 2 13:23 target/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

[source, shell]

$ cp -R dist/target/mvnd-[version] [target-dir]

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!