Maven Command Line Wrapper
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.
Maven Goals and Usage
For the list of goals and a usage guide, please consult the Wiki.
Generating the Maven wrapper
After integrating the wrapper into your Maven project (plugin section), run the following command to generate the wrapper.
mwnw.bat command wrappers are generated at the root of the project folder.
maven folder is generated with the relevant jar and properties file in the project directory.
You can now start using either the
mvnw.bat commands on any project without an existing maven installation!
Pull requests, issues creation, suggestions, documentation improvements are welcome.
Big thank you to all of you who contributed to this project so far.