IMPORTANT: This project is officially retired
- I haven’t updated this for a while
- There was a lack of clarity and communication with bdemers few years ago that led me to fork his project
- Takari then also did his own thing
- I see that the maven wrapper is now officially part of the Maven project
This is a copy of the Gradle wrapper ported for use with Apache Maven. maven-wrapper
is available from Maven Central.
The Maven Command Line Wrapper will auto-download and install Apache Maven from the Internet and then run your Maven goals.
maven-wrapper
ships as Maven plugin that generates wrapper scripts and a configuration file to bootstrap Maven download and installation.
This is a fork of bdemers’ maven-wrapper in order to provide the Maven Wrapper as a Maven plugin, for more flexible reuse/integration. Once you have a Maven project that you want to distribute, you can generate a wrapper so that:
- The target audience can easily execute Maven goals without an existing Maven application as a pre-requisite.
- You can control the version of Maven that is to be used to build the project, if are versions compatibility concerns.
For a full and small practical integration example, checkout the Maven Command Line Wrapper Example project.
If you used to run
mvn clean install
Then you would now run (without a leading ./
for MS Windows)
./mvnw clean install
A wrapper created with Maven 3.0.4 will request Maven 3.0.4, if it’s not already installed on the user’s machine. However, you can still request a specific Maven version by overriding the default behaviour (Maven plugin configuration).
Notes: You need a valid JDK at least 1.6. The plugin was tested with Maven 3.0.2 and above.
For the list of goals and a usage guide, please consult the Wiki.
After integrating the wrapper into your Maven project (plugin section), run the following command to generate the wrapper.
mvn wrapper:wrapper
The mvnw
and mwnw.bat
command wrappers are generated at the root of the project folder.
The maven
folder is generated with the relevant jar and properties file in the project directory.
You can now start using either the mvnw
or mvnw.bat
commands on any project without an existing maven installation!
http://jakub.marchwicki.pl/posts/2015/06/04/maven-wrapper/
Pull requests, issues creation, suggestions, documentation improvements are welcome.
Big thank you to all of you who contributed to this project so far.