While hanging out on GitHub, I discovered a new project: Maven-MVND, which has been dominating GitHub Trending for a few days now.
Maven-mvnd is designed to provide faster builds for Maven. It takes inspiration from Gradle and Takari (Maven lifecycle optimizer).
Github.com/apache/mave…
Maven and Gradle are two of the best build tools for projects. In my opinion, Maven is no better than Gradle and Gradle is no better than Maven.
Look at my fucking point. It’s tactful enough.
Maven’s advantages are that it is stable, works well on the vast majority of projects, and has a strong community that almost all Java developers use. The downside of Maven is that builds are too slow for larger projects.
Gradle has the advantage of being flexible and a little faster to build because of background processes and caching. Gradle’s disadvantages are that versions iterate too quickly, the community can’t keep up, and the learning curve can be steep for beginners.
MVND is not a reconfigured version of Maven, but an intersection of some of the benefits of Maven ∩ (Gradle & Takari).
MVND uses the following architectural approach:
- Maven is embedded internally, so there is no need to install Maven separately.
- It is built using daemons that can service successive requests from multiple MVND clients.
- The built-in GraalVM virtual machine is used, which starts faster, uses less memory, and the internal JIT compiler takes less time to compile than a traditional Java virtual machine.
- If existing daemons are working, you can create multiple daemons to support new build requests.
This architecture further enhances MVND’s performance advantages.
All right, let’s try it out a little bit.
MVND, like Maven, is cross-platform and supports Windows, macOS, and Linux. The commands for automated installation are also very simple, as follows:
# Windows
choco install mvndaemon
# Linux
sdk install mvnd
# macOS
brew install mvndaemon/homebrew-mvnd/mvnd
Copy the code
For the sake of demonstration, I will install it manually, which is also a little faster.
Download the MVND release from:
Github.com/apache/mave…
After the download is complete, decompress the bin directory and add it to PATH.
Run the MVND -v command on the terminal to view the MVND configuration information.
If an error similar to the following does not find JAVA_HOME, you can append the java.home property, which is the JDK installation path, to the corresponding file as prompted.
Just before we set up a Spring Boot project, we can compare the build speed of Maven and MVND.
It takes 5.318 seconds to execute the MVN clean package command.
It takes 3.225 seconds to execute the MVND clean package command.
After repeated tests, MVND is much faster than Maven! Maven stayed at just over five seconds and MVND around three seconds.
Of course, my local Spring Boot project itself is very simple, and MVND would be even more advantageous if it was a project that took a little longer to build.
Feel the MVND in a 24 core computer implementation of the look, it is a miracle of efficiency!
This post has been adapted to GitHub’s 1.0 K + Star open-source column, “The Path to Java Programmer Advancement”. This column is humorous, easy to understand, and extremely friendly and comfortable for Java enthusiasts 😄, The content includes but is not limited to Java foundation, Java Collection framework, Java IO, Java concurrent programming, Java virtual machine, Java enterprise development (Git, SSM, Spring Boot) and other core knowledge points.
This column is also currently topping GitHub Trending (Java category), which makes the second brother finally feel the happiness of topping the list!
Star with this column you have a beacon in the vast ocean of Java knowledge that will never get lost.
Github.com/itwanger/to…
Nothing keeps me here but purpose, and though there are roses by the shore, and trees by the shore, and still harbours, I am not tied.