Install and configure Apache Maven from the binaries provided by the Maven project.
maven resource for pulling a maven artifact from a maven repository and placing it in an arbitrary location.
Note: This cookbook does not handle the installation of Java but does require it to be installed. This can be done either using the Java cookbook (opens in a new tab) or your own cookbook. Check the Maven website (opens in a new tab) for more information about explicit Java requirements.
This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If you’d like to know more please visit sous-chefs.org (opens in a new tab) or come chat with us on the Chef Community Slack in #sous-chefs (opens in a new tab).
- Chef 13+
- ark - used to unpack the maven tarball
node['maven']['version']- specifies the version of maven to install.
node['maven']['m2_home']- defaults to '/usr/local/maven/'
node['maven']['url']- the download url for maven
node['maven']['checksum']- the checksum, which you will have to recalculate if you change the download url using
shasum -a 256 FILENAME
node['maven']['repositories']- an array of maven repositories to use; must be specified as an array. Used in the maven LWRP.
node['maven']['setup_bin']- whether or not to put mvn on your system path, defaults to false
node['maven']['mavenrc']['opts']- value of
MAVEN_OPTSenvironment variable exported via
/etc/mavenrctemplate, defaults to
node['maven']['user']- User to own Maven install, defaults to
Administratordepending on platform.
node['maven']['group']- Group to own Maven install, defaults to
Administratorsdepending on platform.
Installs maven according to the version specified by the
Installs gems required to parse settings.xml to ruby and hash and back to xml
Install a version of Java JRE (Oracle or OpenJDK) that is at minimum the version of Java required by the maven release you are installing (opens in a new tab). This can be done either using the Java cookbook (opens in a new tab) or your own cookbook.
Include the recipe where you want Apache Maven installed.
The maven lwrp has two actions,
:put. They are essentially the same accept that the install action will name the the downloaded file
artifact_id-version.packaging. For example, the mysql jar would be named mysql-5.1.19.jar.
Use the put action when you want to explicitly control the name of the downloaded file. This is useful when you download an artifact and then want to have Chef resources act on files within that the artifact. The put action will creat a file named
name.packaging where name corresponds to the name attribute.
This project exists thanks to all the people who contribute. (opens in a new tab)
Thank you to all our backers!
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.