• Stars
    star
    2,191
  • Rank 21,055 (Top 0.5 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Apache Maven Daemon

mvnd - the Maven Daemon

Introduction

This project aims at providing faster Maven builds using techniques known from Gradle and Takari.

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:

  • By default, 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 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 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:

    103917178 94ee4500 510d 11eb 9abb f52dae58a544

    Once the build is finished, the complete Maven output is forwarded to the console.

How to install mvnd

Install using SDKMAN!

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

$ 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 Homebrew

$ brew install mvndaemon/homebrew-mvnd/mvnd

Install using MacPorts

$ sudo port install mvnd

Install using Chocolatey

$ choco install mvndaemon

Install using Scoop

$ scoop install mvndaemon

Install using asdf

$ asdf plugin-add mvnd
$ asdf install mvnd latest

Set up completion

Optionally, you can set up completion as follows:

# ensure to set MVND_HOME to point 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.

Note for oh-my-zsh users

Users that use oh-my-zsh often use completion for maven. The default maven completion plugin defines mvnd as an alias to mvn deploy. So before being able to use mvnd, you need to unalias using the following command:

$ unalias mvnd

Install manually

  • Download the latest ZIP suitable for your platform from https://downloads.apache.org/maven/mvnd/

  • Unzip to a directory of your choice

  • Add the bin directory to PATH

  • Optionally, you can create ~/.m2/mvnd.properties and set the java.home property in case you do not want to bother with setting JAVA_HOME environment variable.

  • Test whether mvnd works:

    $ mvnd --version
    Maven Daemon 0.0.11-linux-amd64 (native)
    Terminal: org.jline.terminal.impl.PosixSysTerminal with pty org.jline.terminal.impl.jansi.osx.OsXNativePty
    Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
    Maven home: /home/ppalaga/orgs/mvnd/mvnd/daemon/target/maven-distro
    Java version: 11.0.1, vendor: AdoptOpenJDK, runtime: /home/data/jvm/adopt-openjdk/jdk-11.0.1+13
    Default locale: en_IE, platform encoding: UTF-8
    OS name: "linux", version: "5.6.13-200.fc31.x86_64", arch: "amd64", family: "unix"

    If you are on Windows and see a message that 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 oracle/graal#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:

$ xattr -r -d com.apple.quarantine mvnd-x.y.z-darwin-amd64

Usage

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

mvnd verify

mvnd specific options

--status lists running daemons

--stop kills all running daemons

The complete list of options is printed when executing mvnd --help.

Configuration

Configuration can be provided through properties file. Mvnd read properties file from the following locations:

  • the properties path supplied using MVND_PROPERTIES_PATH environment variable or mvnd.propertiesPath system variable

  • the local properties path located at [PROJECT_HOME]/.mvn/mvnd.properties

  • the user properties path located at: [USER_HOME]/.m2/mvnd.properties

  • the system properties path located at: [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 line

  • mvnd.id: this property is used internally to identify the daemon being created

  • mvnd.extClasspath: internal option to specify the maven extension classpath

  • mvnd.coreExtensions: internal option to specify the list of maven extension to register

For a full list of available properties please see /dist/src/main/distro/conf/mvnd.properties.

Build mvnd from source

Prerequisites:

  • git

  • Maven

  • Download and unpack GraalVM CE from GitHub

  • Set JAVA_HOME to where you unpacked GraalVM in the previous step. Check that java -version output is as expected:

    $ $JAVA_HOME/bin/java -version
    openjdk version "11.0.9" 2020-10-20
    OpenJDK Runtime Environment GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06)
    OpenJDK 64-Bit Server VM GraalVM CE 20.3.0 (build 11.0.9+10-jvmci-20.3-b06, mixed mode, sharing)
  • Install the native-image tool:

    $ $JAVA_HOME/bin/gu install native-image
  • native-image may require additional software to be installed depending on your platform - see the native-image documentation.

Build mvnd

$ 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

Install mvnd

$ 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 feedback is most welcome!

More Repositories

1

echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
TypeScript
56,321
star
2

superset

Apache Superset is a Data Visualization and Data Exploration Platform
TypeScript
55,051
star
3

dubbo

The java implementation of Apache Dubbo. An RPC and microservice framework.
Java
40,333
star
4

spark

Apache Spark - A unified analytics engine for large-scale data processing
Scala
36,719
star
5

airflow

Apache Airflow - A platform to programmatically author, schedule, and monitor workflows
Python
36,241
star
6

kafka

Mirror of Apache Kafka
Java
28,624
star
7

incubator-seata

πŸ”₯ Seata is an easy-to-use, high-performance, open source distributed transaction solution.
Java
24,602
star
8

skywalking

APM, Application Performance Monitoring System
Java
22,610
star
9

flink

Apache Flink
Java
22,197
star
10

mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
C++
20,572
star
11

shardingsphere

Distributed SQL transaction & query engine for data sharding, scaling, encryption, and more - on any database.
Java
19,710
star
12

rocketmq

Apache RocketMQ is a cloud native messaging and streaming platform, making it simple to build event-driven applications.
Java
18,578
star
13

arrow

Apache Arrow is the universal columnar format and multi-language toolbox for fast data interchange and in-memory analytics
C++
14,481
star
14

brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
C++
14,261
star
15

incubator-weex

Apache Weex (Incubating)
C++
13,884
star
16

hadoop

Apache Hadoop
Java
13,855
star
17

pulsar

Apache Pulsar - distributed pub-sub messaging system
Java
13,062
star
18

druid

Apache Druid: a high performance real-time analytics database.
Java
12,843
star
19

predictionio

PredictionIO, a machine learning server for developers and ML engineers.
Scala
12,556
star
20

doris

Apache Doris is an easy-to-use, high performance and unified analytics database.
Java
12,490
star
21

zookeeper

Apache ZooKeeper
Java
11,532
star
22

incubator-answer

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
Go
11,487
star
23

apisix

The Cloud-Native API Gateway
Lua
11,031
star
24

thrift

Apache Thrift
C++
9,900
star
25

dolphinscheduler

Apache DolphinScheduler is the modern data workflow orchestration platform with powerful user interface, dedicated to solving complex task dependencies in the data pipeline and providing various types of jobs available `out of the box`
Java
9,619
star
26

cassandra

Mirror of Apache Cassandra
Java
8,187
star
27

shardingsphere-elasticjob

Distributed scheduled job
Java
7,965
star
28

seatunnel

SeaTunnel is a next-generation super high-performance, distributed, massive data integration tool.
Java
7,854
star
29

tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
Python
7,828
star
30

beam

Apache Beam is a unified programming model for Batch and Streaming data processing.
Java
7,737
star
31

shenyu

Apache ShenYu is a Java native API Gateway for service proxy, protocol conversion and API governance.
Java
7,541
star
32

jmeter

Apache JMeter open-source load testing tool for analyzing and measuring the performance of a variety of services
Java
7,335
star
33

tomcat

Apache Tomcat
Java
6,926
star
34

storm

Apache Storm
Java
6,480
star
35

iceberg

Apache Iceberg
Java
6,271
star
36

zeppelin

Web-based notebook that enables data-driven, interactive data analytics and collaborative documents with SQL, Scala and more.
Java
6,162
star
37

openwhisk

Apache OpenWhisk is an open source serverless cloud platform
Scala
6,130
star
38

couchdb

Seamless multi-master syncing database with an intuitive HTTP/JSON API, designed for reliability
Erlang
5,810
star
39

iotdb

Apache IoTDB
Java
5,582
star
40

incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
Java
5,542
star
41

pinot

Apache Pinot - A realtime distributed OLAP datastore
Java
5,430
star
42

dubbo-spring-boot-project

Spring Boot Project for Apache Dubbo
Java
5,355
star
43

mesos

Apache Mesos
Java
5,111
star
44

hive

Apache Hive
Java
5,053
star
45

camel

Apache Camel is an open source integration framework that empowers you to quickly and easily integrate various systems consuming or producing data.
Java
5,042
star
46

groovy

Apache Groovy: A powerful multi-faceted programming language for the JVM platform
Java
4,977
star
47

hbase

Apache HBase
Java
4,971
star
48

incubator-weex-ui

πŸ„ A rich interaction, lightweight, high performance UI library based on Weex.
Vue
4,788
star
49

ignite

Apache Ignite
Java
4,548
star
50

rocketmq-externals

Mirror of Apache RocketMQ (Incubating)
Java
4,474
star
51

incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
C++
4,381
star
52

lucene-solr

Apache Lucene and Solr open-source search software
4,349
star
53

dubbo-go

Go Implementation For Apache Dubbo
Go
4,315
star
54

shiro

Apache Shiro
Java
4,164
star
55

calcite

Apache Calcite
Java
4,028
star
56

nifi

Apache NiFi
Java
4,006
star
57

maven

Apache Maven core
Java
3,836
star
58

hudi

Upserts, Deletes And Incremental Processing on Big Data.
Java
3,804
star
59

dubbo-admin

The ops and reference implementation for Apache Dubbo
Java
3,707
star
60

incubator-heron

Apache Heron (Incubating) is a realtime, distributed, fault-tolerant stream processing engine from Twitter
Java
3,646
star
61

cordova-android

Apache Cordova Android
JavaScript
3,539
star
62

kylin

Apache Kylin
Java
3,526
star
63

httpd

Mirror of Apache HTTP Server. Issues: http://issues.apache.org
C
3,510
star
64

linkis

Apache Linkis builds a computation middleware layer to facilitate connection, governance and orchestration between the upper applications and the underlying data engines.
Java
3,298
star
65

incubator-kie-optaplanner

AI constraint solver in Java to optimize the vehicle routing problem, employee rostering, task assignment, maintenance scheduling, conference scheduling and other planning problems.
Java
3,152
star
66

logging-log4j2

Apache Log4j 2 is a versatile, feature-rich, efficient logging API and backend for Java.
Java
3,151
star
67

fury

A blazingly fast multi-language serialization framework powered by JIT and zero-copy.
Java
3,000
star
68

arrow-datafusion

Apache Arrow DataFusion SQL Query Engine
Rust
2,998
star
69

curator

Apache Curator
Java
2,997
star
70

singa

a distributed deep learning platform
C++
2,968
star
71

avro

Apache Avro is a data serialization system.
Java
2,872
star
72

incubator-streampark

StreamPark, Make stream processing easier! easy-to-use streaming application development framework and operation platform
Scala
2,820
star
73

nutch

Apache Nutch is an extensible and scalable web crawler
Java
2,653
star
74

netbeans

Apache NetBeans
Java
2,643
star
75

guacamole-server

Mirror of Apache Guacamole Server
C
2,601
star
76

incubator-devlake

Apache DevLake is an open-source dev data platform to ingest, analyze, and visualize the fragmented data from DevOps tools, extracting insights for engineering excellence, developer experience, and community growth.
Go
2,578
star
77

commons-lang

Apache Commons Lang
Java
2,539
star
78

flume

Mirror of Apache Flume
Java
2,458
star
79

geode

Apache Geode
Java
2,244
star
80

gobblin

A distributed data integration framework that simplifies common aspects of big data integration such as data ingestion, replication, organization and lifecycle management for both streaming and batch data ecosystems.
Java
2,209
star
81

incubator-seata-samples

seata-samples
Java
2,196
star
82

activemq

Mirror of Apache ActiveMQ
Java
2,184
star
83

incubator-hugegraph

A graph database that supports more than 100+ billion data, high performance and scalability (Include OLTP Engine & REST-API & Backends)
Java
2,156
star
84

parquet-mr

Apache Parquet
Java
2,153
star
85

kvrocks

Kvrocks is a distributed key value NoSQL database that uses RocksDB as storage engine and is compatible with Redis protocol.
C++
2,147
star
86

pdfbox

Mirror of Apache PDFBox
Java
2,131
star
87

cordova-ios

Apache Cordova iOS
JavaScript
2,130
star
88

mahout

Mirror of Apache Mahout
Java
2,095
star
89

lucenenet

Apache Lucene.NET
C#
2,031
star
90

ambari

Apache Ambari simplifies provisioning, managing, and monitoring of Apache Hadoop clusters.
Java
1,990
star
91

incubator-pegasus

Apache Pegasus - A horizontally scalable, strongly consistent and high-performance key-value store
C++
1,962
star
92

libcloud

Apache Libcloud is a Python library which hides differences between different cloud provider APIs and allows you to manage different cloud resources through a unified and easy to use API.
Python
1,956
star
93

cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
Java
1,945
star
94

tika

The Apache Tika toolkit detects and extracts metadata and text from over a thousand different file types (such as PPT, XLS, and PDF).
Java
1,860
star
95

drill

Apache Drill is a distributed MPP query layer for self describing data
Java
1,841
star
96

dubbo-samples

samples for Apache Dubbo
Java
1,839
star
97

servicecomb-java-chassis

ServiceComb Java Chassis is a Software Development Kit (SDK) for rapid development of microservices in Java, providing service registration, service discovery, dynamic routing, and service management features
Java
1,829
star
98

tinkerpop

Apache TinkerPop - a graph computing framework
Java
1,825
star
99

trafficserver

Apache Traffic Serverβ„’ is a fast, scalable and extensible HTTP/1.1 and HTTP/2 compliant caching proxy server.
C++
1,804
star
100

bookkeeper

Apache BookKeeper - a scalable, fault tolerant and low latency storage service optimized for append-only workloads
Java
1,785
star