mvnd is so much faster than maven from entry to large-scale system practice

brief introduction

mvnd is a new build tool based on {maven} with reference to} gradle and} takari, but faster than it;

For more information, see the official website: github.com/apache/mave...

install

Download mvnd

Enter github.com/apache/mave...

I downloaded mvnd-0.7.1-windows-amd 64 zip

After downloading, find a path and unzip it

to configure

Configure JDK

Because mvnd depends on jdk startup, we need to configure jdk first

Let's take a 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 code

The exception tells us that in the configuration file Java Home and environment variables JAVA_HOME not found

Then we will make some configuration based on this error. The method is very simple. I have listed two schemes here. We only need to choose the most suitable one

The first is based on environment variables

The second is the configuration file based on mvnd

1. Environmental variable method

Note: mvnd requires the environment variable JAVA_HOME, otherwise an error will be reported

I won't list the specific configuration methods here.

2. Configuration file method

In some cases, we need to configure jdk11 or higher in the environment variable, while mvnd needs jdk1 What about 8?

In this case, we can use the second method. Please see the following instructions for specific operations

We can also choose to manually specify the path of the jdk in the mvnd-0.7.1-windows-amd64\conf directory

First we open mvnd Properties file

Find Java The line where home is located is about 149. We can first cancel the comment (#), and then fill in the jdk path at the path

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

mvnd clean
 Copy code

After modification and saving, let's test

Set mvnd environment variable

After setting the mvnd environment variable, you can use the mvnd command in any directory. The specific configuration is not listed.

Set the maven configuration built into mvnd

Under the directory \ mvn is the built-in maven of mvnd. There is no difference between maven used in peacetime

Therefore, when configuring maven, we directly modify the settings under \ mvn\conf XML is enough

The specific configuration is the same as maven

Specify settings xml

Note: in mvnd, you will not directly use {settings} under} mvnd\mvn\conf XML configuration, we need to manually execute the configuration file path

First, we open mvnd \ conf \ mvnd Properties file

Then at the bottom, find {Maven Settings configuration item

We uncomment this configuration item, and then delete mvnd \ MVN \ conf \ settings Fill in the absolute path of XML #

Please see the picture for details

Actual combat of large screen system

There are 14 projects in this actual combat project. Let's take a look at the time-consuming execution using {mvn} and} mvnd}

Statement: this test only represents the use records of individuals in the actual development process. It is not professional, but it also has certain reference performance

Test preconditions

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

settings.xml is configured in the same way

system performance

The test machine is the real development machine of the company, and the load condition is also true

Test target

Use the following command twice

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

test result

install

> mvn clean install
- 1. for the first time
[INFO] xxx ............................................ SUCCESS [  0.199 s]
[INFO] xxx-admin-core ................................. SUCCESS [  1.794 s]
[INFO] xxx-common ..................................... SUCCESS [  3.103 s]
[INFO] xxx-system ..................................... SUCCESS [  0.489 s]
[INFO] xxx-framework .................................. SUCCESS [  0.758 s]
[INFO] xxx-admin ...................................... SUCCESS [  2.024 s]
[INFO] xxx-admin-backend .............................. SUCCESS [  4.230 s]
[INFO] xxx-eee-itc ............................... SUCCESS [  0.900 s]
[INFO] xxx-eee-hls ............................... SUCCESS [  1.956 s]
[INFO] xxx-eee-haiwan ............................ SUCCESS [  5.842 s]
[INFO] xxx-eee-unisee ............................ SUCCESS [  5.080 s]
[INFO] xxx-eee-temperature ....................... SUCCESS [  5.021 s]
[INFO] xxx-eee-schneider ......................... SUCCESS [  7.080 s]
[INFO] xxx-eee-common ............................ SUCCESS [  5.448 s]
[INFO] xxx-eee-statistics ........................ SUCCESS [  5.555 s]
[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 time
[INFO] xxx ............................................ SUCCESS [  0.195 s]
[INFO] xxx-admin-core ................................. SUCCESS [  1.857 s]
[INFO] xxx-common ..................................... SUCCESS [  3.161 s]
[INFO] xxx-system ..................................... SUCCESS [  0.519 s]
[INFO] xxx-framework .................................. SUCCESS [  0.738 s]
[INFO] xxx-admin ...................................... SUCCESS [  2.049 s]
[INFO] xxx-admin-backend .............................. SUCCESS [  3.827 s]
[INFO] xxx-eee-itc ............................... SUCCESS [  1.078 s]
[INFO] xxx-eee-hls ............................... SUCCESS [  1.521 s]
[INFO] xxx-eee-haiwan ............................ SUCCESS [  6.198 s]
[INFO] xxx-eee-unisee ............................ SUCCESS [  5.261 s]
[INFO] xxx-eee-temperature ....................... SUCCESS [  6.103 s]
[INFO] xxx-eee-schneider ......................... SUCCESS [  4.787 s]
[INFO] xxx-eee-common ............................ SUCCESS [  5.369 s]
[INFO] xxx-eee-statistics ........................ SUCCESS [  5.804 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  48.913 s
[INFO] Finished at: 2022-01-05T10:13:32+08:00
[INFO] ------------------------------------------------------------------------
Copy code
> mvnd clean install

- 1. for the first time
[INFO] xxx ............................................ SUCCESS [  0.005 s]
[INFO] xxx-admin-core ................................. SUCCESS [  0.308 s]
[INFO] xxx-common ..................................... SUCCESS [  1.435 s]
[INFO] xxx-system ..................................... SUCCESS [  0.291 s]
[INFO] xxx-framework .................................. SUCCESS [  0.495 s]
[INFO] xxx-admin ...................................... SUCCESS [  1.391 s]
[INFO] xxx-admin-backend .............................. SUCCESS [ 19.003 s]
[INFO] xxx-eee-itc ............................... SUCCESS [ 19.376 s]
[INFO] xxx-eee-hls ............................... SUCCESS [ 18.461 s]
[INFO] xxx-eee-haiwan ............................ SUCCESS [ 12.390 s]
[INFO] xxx-eee-unisee ............................ SUCCESS [  0.858 s]
[INFO] xxx-eee-temperature ....................... SUCCESS [  0.834 s]
[INFO] xxx-eee-schneider ......................... SUCCESS [ 17.140 s]
[INFO] xxx-eee-common ............................ SUCCESS [ 12.672 s]
[INFO] xxx-eee-statistics ........................ SUCCESS [  0.835 s]
[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 time
[INFO] xxx ............................................ SUCCESS [  0.004 s]
[INFO] xxx-admin-core ................................. SUCCESS [  0.310 s]
[INFO] xxx-common ..................................... SUCCESS [  1.573 s]
[INFO] xxx-system ..................................... SUCCESS [  0.298 s]
[INFO] xxx-framework .................................. SUCCESS [  0.418 s]
[INFO] xxx-admin ...................................... SUCCESS [  1.407 s]
[INFO] xxx-admin-backend .............................. SUCCESS [ 19.343 s]
[INFO] xxx-eee-itc ............................... SUCCESS [ 17.165 s]
[INFO] xxx-eee-hls ............................... SUCCESS [ 16.195 s]
[INFO] xxx-eee-haiwan ............................ SUCCESS [ 11.439 s]
[INFO] xxx-eee-unisee ............................ SUCCESS [  1.213 s]
[INFO] xxx-eee-temperature ....................... SUCCESS [  1.127 s]
[INFO] xxx-eee-schneider ......................... SUCCESS [ 17.177 s]
[INFO] xxx-eee-common ............................ SUCCESS [ 12.903 s]
[INFO] xxx-eee-statistics ........................ SUCCESS [  1.179 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  40.317 s (Wall Clock)
[INFO] Finished at: 2022-01-05T10:18:38+08:00
[INFO] ------------------------------------------------------------------------
Copy code

package

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

result

mvnd is faster than mvn

Keywords: Java Gradle Maven Deep Learning

Added by papa on Wed, 05 Jan 2022 17:31:20 +0200