When we used Spring Initializr to create a Spring Boot project, did we find two files named MVNW in the project root directory:

Given the name, icon, and extension, the two files should be the same, except that the CMD file should be used for Windows running and the other one for Linux running.

Welcome to the Spring Boot series of free tutorials.

So what exactly is this file for? Let’s try to understand:

Step 1: Open and read

Because the content is more, I will not put out here. The content is pretty straightforward, and if you know anything about Shell and Maven, you’ll know that this script does a few things:

  1. Check to see if you have Maven installed, and if not, automatically download one (so you can complete subsequent build tasks).
  2. Check whether you have Java installed or configured correctly. This cannot be done by yourself. If an error is reported, you need to fix it yourself.
  3. Check if there are any version incompatibilities, if not, he will download the appropriate version to help you complete the build

More details of the inspection can be opened to view and learn

Step 2: Perform validation

Run the MVNW install command

Once the build is complete, let’s see:

Perfect! Easy and simple to complete a Spring Boot project construction!

If you haven’t paid attention to this stuff before, you might as well open it now, and try to run it, have a intuitive feeling!

Welcome to pay attention to my public account: Program monkey DD, get the exclusive arrangement of learning resources, daily dry goods and welfare gifts.