Custom resources for installing Apache Maven, downloading Maven artifacts, and
editing settings.xml.
Use the custom resources directly:
maven_installmaven_artifactmaven_settings
This cookbook does not install Java. Ensure a compatible JDK is present before
using the mvn binary or maven_artifact.
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 or come chat with us on the Chef Community Slack in #sous-chefs.
The cookbook metadata currently supports:
- AlmaLinux 9+
- Amazon Linux 2023+
- Debian 12+
- Debian 13+
- Fedora
- Rocky Linux 9+
- Ubuntu 22.04+
- Chef Infra Client 16+
ark5.0+
Installs Apache Maven from the upstream binary tarball, manages the Maven home,
and writes a mavenrc file with M2_HOME and MAVEN_OPTS.
maven_install 'default' do
version '3.9.14'
endDownloads an artifact from one or more remote repositories by invoking the
Maven dependency plugin through mvn.
maven_artifact 'mysql-connector-j' do
group_id 'com.mysql'
version '8.4.0'
dest '/opt/app/lib'
endUpdates a value in an existing settings.xml file by dotted path.
maven_settings 'settings.localRepository' do
value '/srv/maven-repository'
endInstall a supported JDK first, then declare the resources you need in your own wrapper cookbook. A typical flow is:
- Install Java with your preferred cookbook or base image.
- Use
maven_installto place Maven on the node. - Use
maven_settingsto adjustsettings.xmlif needed. - Use
maven_artifactto fetch application dependencies or deployment assets.
See test/cookbooks/test/recipes/default.rb for the full default-suite example
that exercises all three resources together.
See LIMITATIONS.md for supported platforms, architecture notes, and current behavioral constraints of the resources.
This project exists thanks to all the people who contribute.
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.