Skip to content

Commit

Permalink
Explain project better in README apache#75
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalaga committed Sep 30, 2020
1 parent 49a360d commit 0b19793
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
= `mvnd` - the Maven Daemon

The mvnd project aims to provide a daemon infrastructure for maven based builds. It borrows techniques from Gradle and
Takari to provide a simple and efficient system.
This project aims at providing faster Maven builds using techniques known from Gradle and Takari.

== Install `mvnd`
== Architecture overview

* `mvnd` embeds Maven (so there is no need to install Maven separately).
* The actual builds happen inside a long living background process, a.k.a. daemon.
* One daemon instance can serve multiple consecutive requests from the `mvnd` client.
* The `mvnd` client is a native executable built using GraalVM. It starts faster and uses less memory compared to
starting a traditional JVM.
* Multiple daemons can be spawned in parallel if there is no idle daemon to serve a build request.

This architecture brings the following advantages:

* The JVM for running the actual builds does not need to get started anew for each build.
* The classloaders holding classes of Maven plugins are cached over multiple builds. The plugin jars are thus read
and parsed just once. SNAPSHOT versions of Maven plugins are not cached.
* The native code produced by the Just-In-Time (JIT) compiler inside the JVM is kept too. Compared to stock Maven,
less time is spent by the JIT compilation. During the repeated builds the JIT-optimized code is available
immediately. This applies not only to the code coming from Maven plugins and Maven Core, but also to all code coming
from the JDK itself.

== Additional features

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

* `-T1C` is used by default. This means builing in parallel using as many threads as CPU cores on your machine. If your
source tree does not support parallel builds, pass `-T1` on the command line to make your build serial.
* Improved console output: we believe that the output of a parallel build on a stock Maven is hard to follow. Therefore,
we implemented a simplified a non-rolling view showing the status of each build thread on a separate line. This is
what it looks like on a machine with 24 cores:
+
image::src/main/images/console-output.png[]
+
Once the build is finshed, the complete Maven output is forwarded to the console.

== How to install `mvnd`

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

Expand Down
Binary file added src/main/images/console-output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0b19793

Please sign in to comment.