This article has participated in the activity of “New person creation Ceremony”, and started the road of digging gold creation together.

Environment description Windows 10 i5-4460 3.2Hz 16G mvnd-0.7.1- Windows -amd64 jdk1.8Copy the code

Introduction to the

MVND is a faster maven-based build tool based on gradle and Takari.

For more information, check out github.com/apache/mave…

The installation

Download MVND

Enter the github.com/apache/mave…

I downloaded mVnD-0.7.1 – Windows-amd64.zip

After downloading, find a path and decompress it

configuration

Configure the JDK

Since MVND relies on JDK startup, we need to configure the JDK first

Let’s look at the error log first

> mvnd clean Exception in thread "main" java.lang.IllegalStateException: Could not get value for Environment.JAVA_HOME from any of the following sources: value: java.home, environment variable JAVA_HOME, property java.home in E:\workspace\traffic_stat_backend.mvn\mvnd.properties, property java.home in C:\Users\Administrator.m2\mvnd.properties, Property Java. Home in D: \ Java \ MVND - 0.7.1 - Windows - amd64 \ conf \ MVND properties, system property java.home at org.mvndaemon.mvnd.client.DaemonParameters$EnvValue.couldNotgetValue(DaemonParameters.java:596) at org.mvndaemon.mvnd.client.DaemonParameters$EnvValue.lambda$orFail$8(DaemonParameters.java:573) at org.mvndaemon.mvnd.client.DaemonParameters$EnvValue.get(DaemonParameters.java:606) at org.mvndaemon.mvnd.client.DaemonParameters$EnvValue.asPath(DaemonParameters.java:629) at org.mvndaemon.mvnd.client.DaemonParameters.javaHome(DaemonParameters.java:140) at org.mvndaemon.mvnd.client.DaemonConnector.connect(DaemonConnector.java:99) at org.mvndaemon.mvnd.client.DefaultClient.execute(DefaultClient.java:272) at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:118)Copy the code

An exception tells us that the configuration file java.home and the environment variable JAVA_HOME are not found

So let’s do some configuration based on this error. The way is very simple, I have listed two options here, we just need to choose the one that works best for us

The first is based on environment variables

The second method is based on MVND profile

1. Environment variable method

Note: MVND requires the environment variable JAVA_HOME or an error will be reported

I will not list the specific configuration methods here.

2. Configuration file method

In some cases, we need to configure JDK11 or higher in the environment variable, and MVND needs JDK1.8?

In this case, we can use the second method, see the instructions below

Alternatively, you can manually specify the JDK path in the Mvnd-0.7.1 -windows-amd64\conf directory

First we open the mvnd.properties file

Go to the java.home line, about line 149, and uncomment (#), then fill in the JDK path

After the modification, we execute the command again, and we can see that it has been successfully executed

mvnd clean
Copy the code

We’ll test it after we save it

Set the MVND environment variable

After setting the MVND environment variable, we can use the MVND command in any directory, the specific configuration is not listed.

Set the maven configuration built into MVND

MVN directory is MVND built-in Maven, and the use of maven is the same

To configure Maven, modify settings. XML under \ MVN \conf

The specific configuration is the same as for Maven

Specify the Settings. The XML

Note: in MVND, settings. XML under MVND \ MVN \conf is not configured directly. We need to manually execute the configuration file path

First we open the MVND \conf\mvnd.properties file

Then, at the bottom, locate the Maven.Settings configuration item

We uncomment this configuration item and fill in our absolute path to MVND \ MVN \conf\settings.xml

Please see the picture for details.

Large screen system actual combat

The actual combat project has 14 projects, let’s take a look at the execution time using MVN and MVND

Disclaimer: this test only represents the actual use of personal development records, not professional, but also has a certain reference performance

Test preconditions

After each test all projects are in the installed state (that is, after the MVN clean install command is executed)

Settings. XML is configured in the same way

The system performance

This test machine is the company’s real development machine, and the load is real

Test objectives

Run the following commands twice

  1. mvn clean install & mvnd clean install
  2. mvn clean package & mvnd clean package

The test results

install

> MVN clean install - 1. For the first time [INFO] XXX... SUCCESS [s] 0.199 [INFO] XXX - admin - core... SUCCESS [s] 1.794 [INFO] XXX - common... SUCCESS [s] 3.103 [INFO] XXX - system... SUCCESS [s] 0.489 [INFO] XXX - the framework... SUCCESS [s] 0.758 [INFO] XXX - admin... SUCCESS [s] 2.024 [INFO] XXX - admin - backend... SUCCESS [s] 4.230 [INFO] XXX - eee - itc... SUCCESS [s] 0.900 [INFO] - eee - HLS XXX... SUCCESS [s] 1.956 [INFO] - eee - haiwan XXX... SUCCESS [s] 5.842 [INFO] - eee - unisee XXX... SUCCESS [s] 5.080 [INFO] XXX - eee - temperature... SUCCESS [s] 5.021 [INFO] - eee - schneider XXX... SUCCESS [s] 7.080 [INFO] XXX - eee - common... SUCCESS [s] 5.448 [INFO] XXX - eee - statistics... SUCCESS [s] 5.555 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 49.942 s [INFO] Finished at: 2022-01-05T10:12:23+08:00 [INFO] ------------------------------------------------------------------------ - 2. The second [INFO] XXX... SUCCESS [s] 0.195 [INFO] XXX - admin - core... SUCCESS [s] 1.857 [INFO] XXX - common... SUCCESS [s] 3.161 [INFO] XXX - system... SUCCESS [s] 0.519 [INFO] XXX - the framework... SUCCESS [s] 0.738 [INFO] XXX - admin... SUCCESS [s] 2.049 [INFO] XXX - admin - backend... SUCCESS [s] 3.827 [INFO] XXX - eee - itc... SUCCESS [s] 1.078 [INFO] - eee - HLS XXX... SUCCESS [s] 1.521 [INFO] - eee - haiwan XXX... SUCCESS [s] 6.198 [INFO] - eee - unisee XXX... SUCCESS [s] 5.261 [INFO] XXX - eee - temperature... SUCCESS [s] 6.103 [INFO] - eee - schneider XXX... SUCCESS [s] 4.787 [INFO] XXX - eee - common... SUCCESS [s] 5.369 [INFO] XXX - eee - statistics... SUCCESS [s] 5.804 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 48.913s [INFO] Finished at: 2022-01-05T10:13:32+08:00 [INFO] ------------------------------------------------------------------------Copy the code
> MVND clean install - 1. For the first time [INFO] XXX... SUCCESS [s] 0.005 [INFO] XXX - admin - core... SUCCESS [s] 0.308 [INFO] XXX - common... SUCCESS [s] 1.435 [INFO] XXX - system... SUCCESS [s] 0.291 [INFO] XXX - the framework... SUCCESS [s] 0.495 [INFO] XXX - admin... SUCCESS [s] 1.391 [INFO] XXX - admin - backend... SUCCESS [s] 19.003 [INFO] XXX - eee - itc... SUCCESS [s] 19.376 [INFO] - eee - HLS XXX... SUCCESS [s] 18.461 [INFO] - eee - haiwan XXX... SUCCESS [s] 12.390 [INFO] - eee - unisee XXX... SUCCESS [s] 0.858 [INFO] XXX - eee - temperature... SUCCESS [s] 0.834 [INFO] - eee - schneider XXX... SUCCESS [s] 17.140 [INFO] XXX - eee - common... SUCCESS [s] 12.672 [INFO] XXX - eee - statistics... SUCCESS [s] 0.835 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 41.776 s (Wall Clock) [INFO] Finished at: 2022-01-05T10:17:15+08:00 [INFO] ------------------------------------------------------------------------ - 2. The second [INFO] XXX... SUCCESS [s] 0.004 [INFO] XXX - admin - core... SUCCESS [s] 0.310 [INFO] XXX - common... SUCCESS [s] 1.573 [INFO] XXX - system... SUCCESS [s] 0.298 [INFO] XXX - the framework... SUCCESS [s] 0.418 [INFO] XXX - admin... SUCCESS [s] 1.407 [INFO] XXX - admin - backend... SUCCESS [s] 19.343 [INFO] XXX - eee - itc... SUCCESS [s] 17.165 [INFO] - eee - HLS XXX... SUCCESS [s] 16.195 [INFO] - eee - haiwan XXX... SUCCESS [s] 11.439 [INFO] - eee - unisee XXX... SUCCESS [s] 1.213 [INFO] XXX - eee - temperature... SUCCESS [s] 1.127 [INFO] - eee - schneider XXX... SUCCESS [s] 17.177 [INFO] XXX - eee - common... SUCCESS [s] 12.903 [INFO] XXX - eee - statistics... SUCCESS [s] 1.179 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 40.317s (Wall Clock) [INFO] Finished at: 2022-01-05T10:18:38+08:00 [INFO] ------------------------------------------------------------------------Copy the code

package

> MVN clean package - 1. The first time [INFO] XXX... SUCCESS [s] 0.115 [INFO] XXX - admin - core... SUCCESS [s] 1.970 [INFO] XXX - common... SUCCESS [s] 3.123 [INFO] XXX - system... SUCCESS [s] 0.504 [INFO] XXX - the framework... SUCCESS [s] 0.769 [INFO] XXX - admin... SUCCESS [s] 2.711 [INFO] XXX - admin - backend... SUCCESS [s] 3.065 [INFO] XXX - eee - itc... SUCCESS [s] 0.776 [INFO] - eee - HLS XXX... SUCCESS [s] 0.811 [INFO] - eee - haiwan XXX... SUCCESS [s] 1.110 [INFO] - eee - unisee XXX... SUCCESS [s] 1.733 [INFO] XXX - eee - temperature... SUCCESS [s] 0.844 [INFO] - eee - schneider XXX... SUCCESS [s] 1.169 [INFO] XXX - eee - common... SUCCESS [s] 2.295 [INFO] XXX - eee - statistics... SUCCESS [s] 3.024 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 24.509 s [INFO] Finished at: 2022-01-05T10:21:31+08:00 [INFO] ------------------------------------------------------------------------ - 2. The second [INFO] XXX... SUCCESS [s] 0.111 [INFO] XXX - admin - core... SUCCESS [s] 1.981 [INFO] XXX - common... SUCCESS [s] 3.235 [INFO] XXX - system... SUCCESS [s] 0.507 [INFO] XXX - the framework... SUCCESS [s] 0.790 [INFO] XXX - admin... SUCCESS [s] 1.996 [INFO] XXX - admin - backend... SUCCESS [s] 2.947 [INFO] XXX - eee - itc... SUCCESS [s] 0.747 [INFO] - eee - HLS XXX... SUCCESS [s] 0.910 [INFO] - eee - haiwan XXX... SUCCESS [s] 0.703 [INFO] - eee - unisee XXX... SUCCESS [s] 1.179 [INFO] XXX - eee - temperature... SUCCESS [s] 1.527 [INFO] - eee - schneider XXX... SUCCESS [s] 1.405 [INFO] XXX - eee - common... SUCCESS [s] 1.024 [INFO] XXX - eee - statistics... SUCCESS [s] 2.238 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 21.709 s [INFO] Finished at: 2022-01-05T10:22:14+08:00 [INFO] ------------------------------------------------------------------------Copy the code
> MVND clean package - 1. For the first time [INFO] XXX... SUCCESS [s] 0.023 [INFO] XXX - admin - core... SUCCESS [s] 0.393 [INFO] XXX - common... SUCCESS [s] 1.507 [INFO] XXX - system... SUCCESS [s] 0.294 [INFO] XXX - the framework... SUCCESS [s] 0.417 [INFO] XXX - admin... SUCCESS [s] 1.354 [INFO] XXX - admin - backend... SUCCESS [s] 6.264 [INFO] XXX - eee - itc... SUCCESS [s] 1.562 [INFO] - eee - HLS XXX... SUCCESS [s] 2.281 [INFO] - eee - haiwan XXX... SUCCESS [s] 2.067 [INFO] - eee - unisee XXX... SUCCESS [s] 1.049 [INFO] XXX - eee - temperature... SUCCESS [s] 0.907 [INFO] - eee - schneider XXX... SUCCESS [s] 1.516 [INFO] XXX - eee - common... SUCCESS [s] 2.832 [INFO] XXX - eee - statistics... SUCCESS [s] 0.948 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.251s (Wall Clock) [INFO] Finished at: 2022-01-05T10:23:18+08:00 [INFO] ------------------------------------------------------------------------ - 2. The second [INFO] XXX... SUCCESS [s] 0.001 [INFO] XXX - admin - core... SUCCESS [s] 0.376 [INFO] XXX - common... SUCCESS [s] 1.523 [INFO] XXX - system... SUCCESS [s] 0.289 [INFO] XXX - the framework... SUCCESS [s] 0.415 [INFO] XXX - admin... SUCCESS [s] 1.474 [INFO] XXX - admin - backend... SUCCESS [s] 8.787 [INFO] XXX - eee - itc... SUCCESS [s] 0.729 [INFO] - eee - HLS XXX... SUCCESS [s] 0.678 [INFO] - eee - haiwan XXX... SUCCESS [s] 5.181 [INFO] - eee - unisee XXX... SUCCESS [s] 0.751 [INFO] XXX - eee - temperature... SUCCESS [s] 0.699 [INFO] - eee - schneider XXX... SUCCESS [s] 0.714 [INFO] XXX - eee - common... SUCCESS [s] 5.172 [INFO] XXX - eee - statistics... SUCCESS [s] 0.709 [INFO] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 12.856 s (Wall Clock) [INFO] Finished at: 2022-01-05T10:23:50+08:00 [INFO] ------------------------------------------------------------------------Copy the code

The results of

MVND faster than MVN

The problem

  • Can it completely replace MVN?
  • How do I replace tools such as IDEA with MVND?
  • HXDS think so? Let’s talk in the comments below!