maven/maven-wrapper
Dave Syer 10296a8036 Fix while loop so that basedir is detected in current dir
There was a problem with the logic in the while loop that detects
the base dir - it should first look in the current directory,
otherwise you can't build in a directory with local settings because
it will always climb up and find .mvn in a parent directory (e.g. user's
home).
2020-06-21 11:17:22 +02:00
..
.mvn/wrapper Update properties path 2020-06-21 11:17:11 +02:00
src Remove some unused parts of the windows scripts and rename them to .cmd 2020-06-21 11:17:19 +02:00
.gitignore Formatting 2020-06-21 11:16:57 +02:00
LICENSE.txt Add license file 2020-06-21 11:17:20 +02:00
README.md Fix typo 2020-06-21 11:17:18 +02:00
mvnw Fix while loop so that basedir is detected in current dir 2020-06-21 11:17:22 +02:00
mvnw.cmd Remove some unused parts of the windows scripts and rename them to .cmd 2020-06-21 11:17:19 +02:00
pom.xml Add license stanza to POM 2020-06-21 11:17:21 +02:00

README.md

Maven Wrapper

The Maven Wrapper is an easy way to ensure a user of your Maven build has everything necessary run your Maven build. Why might this be necessary? Maven to date has been very stable for users, is available on most systems or is easy to procure: but with many of the recent changes in Maven it will be easier for users to have a fully encapsulated build setup provided by the project. With the Maven Wrapper this is very easy to do and it's a great idea borrowed from Gradle.

The easiest way to setup the Maven Wrapper for your project is to use the Takari Maven Plugin with its provided wrapper goal. To add all the necessary Maven Wrapper files to your project execute the following command:

mvn -N io.takari:maven:wrapper

Normally you instruct user to run the mvn command like the following:

$ mvn clean install

But now, with a Maven Wrapper setup, you can instruct users to run wrapper scripts:

$ ./mvnw clean install

or

$ ./mvnw.bat clean install

A normal Maven build will be executed with the one important change that if the user doesn't have the necessary version of Maven specified in .mvn/wrapper/maven-wrapper.properties it will be downloaded for the user first.