Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms

Select Status

RSS

maven (45) Versions 5.2.0

Installs Apache Maven includes a resource for installing artifacts from maven

Policyfile
Berkshelf
Knife
cookbook 'maven', '= 5.2.0', :supermarket
cookbook 'maven', '= 5.2.0'
knife supermarket install maven
knife supermarket download maven
README
Dependencies
Changelog
Quality 83%

maven Cookbook

Build Status Cookbook Version

Install and configure Apache Maven from the binaries provided by the Maven project.

Provides the maven LWRP 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 or your own cookbook. Check the Maven website for more information about explicit Java requirements.

Requirements

Platforms

  • Debian/Ubuntu
  • RHEL/CentOS/Scientific/Amazon/Oracle
  • Fedora
  • Windows

Chef

  • Chef 12.5+

Cookbooks

  • java - java_ark custom resource used by the Maven LWRP
  • ark - used to unpack the maven tarball

Attributes

  • 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_OPTS environment variable exported via /etc/mavenrc template, defaults to -Dmaven.repo.local=$HOME/.m2/repository -Xmx384m
  • node['maven']['user'] - User to own Maven install, defaults to root or Administrator depending on platform.
  • node['maven']['group'] - Group to own Maven install, defaults to root or Administrators depending on platform.

Recipes

default

Installs maven according to the version specified by the node['maven']['version'] attribute.

settings

Installs gems required to parse settings.xml to ruby and hash and back to xml

Usage

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. This can be done either using the Java cookbook or your own cookbook.

Include the recipe where you want Apache Maven installed.

The maven lwrp has two actions, :install and :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.

Providers/Resources

maven_settings

Resource provider for modifying the maven settings.

Actions

Action Description Default
update Updates a global maven setting to a new value. Yes

Attributes

Attribute Description Type Default
path Period '.' delimited path to element of the settings that is going to be changed. String name
value The new value to update the path to. String, TrueClass, FalseClass, Hash

In order to use this resource you first need to run settings recipe which will installed required bury gems for you. Find below exampl on how to update proxy in settings.xml

maven_settings "settings.proxies" do
  value "proxy" => {
    "active" => true,
    "protocaol" => "http",
    "host" => "proxy.myorg.com",
    "port" => 80,
    "nonProxyHosts" => ".myorg.com"
  }
end

maven

  • artifact_id - if this is not specified, the resource's name is used
  • group_id - group_id for the artifact
  • version - version of the artifact
  • dest - the destination folder for the jar and its dependencies
  • packaging - defaults to 'jar'
  • classifier - distinguishes artifacts that were built from the same POM but differ in context
  • repositories - array of maven repositories to use, defaults to ["http://repo1.maven.apache.org/maven2"]
  • owner - the owner of the resulting file, default is root
  • group - the group of the resulting file, default is root's group
  • mode - integer value for file permissions, default is 0644
  • transitive - whether to resolve dependencies transitively, defaults to false. Please note: Event true will only place one artifact in dest. All others are downloaded to the local repository.
  • timeout - sets the timeout (in seconds) of file download, default is 600

Examples

maven 'mysql-connector-java' do
  group_id 'mysql'
  version  '5.1.19'
  dest     '/usr/local/tomcat/lib/'
end
# The artifact will be downloaded to /usr/local/tomcat/lib/mysql-connector-java-5.1.19.jar

maven 'solr' do
  group_id  'org.apache.solr'
  version   '3.6.1'
  packaging 'war'
  dest      '/usr/local/tomcat/webapps/'
  action    :put
end
# The artifact will be downloaded to /usr/local/tomcat/webapps/solr.war

maven 'custom-application' do
  group_id   'com.company.name'
  version    '2.0.0'
  dest       '/usr/local/tomcat/lib'
  classifier 'client'
  action     :put
end
# The artifact will be downloaded to /usr/local/tomcat/lib/custom-application-2.0.0-client.jar

License & Authors

Author: Seth Chisamore (schisamo@chef.io)

Author: Bryan W. Berry (bryan.berry@gmail.com)

Author: Leif Madsen (lmadsen@thinkingphones.com)

Copyright: 2008-2017, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Dependent cookbooks

ark >= 1.0

Contingent cookbooks

application_mvn Applicable Versions
artifact-deployer Applicable Versions
baragon Applicable Versions
coffee-truck Applicable Versions
couchdb Applicable Versions
et_mesos Applicable Versions
exhibitor Applicable Versions
gerrit Applicable Versions
jahia Applicable Versions
java-service Applicable Versions
jenkins_drupal Applicable Versions
jenkins_plugins Applicable Versions
memcached_session_manager Applicable Versions
polyglot Applicable Versions
seyren Applicable Versions
singularity Applicable Versions
singularity_executor Applicable Versions
yajsw Applicable Versions

maven Cookbook CHANGELOG

This file is used to list changes made in each version of the maven cookbook.

5.2.0 (2018-07-23)

  • Remove ChefSpec matchers that are auto generated now
  • Verify install_ark resource is correctly called
  • Add ability to install Maven under different user/group and auto create that user/group

5.1.0 (2017-11-28)

  • Update version of maven installed
  • Remove java dependency (add to test cookbook)

5.0.3 (2017-11-01)

  • Fix the archive URL for realz this time

5.0.2 (2017-11-01)

  • Update the default maven URL to use the apache.org archive site since the binary has been moved off the main site

5.0.1 (2017-05-28)

  • Close settings.xml file after writing.
  • Increase requirement to 12.6+ as we can't use action_class.class_eval at this point

5.0.0 (2017-04-26)

  • Add new setup_bin attribute to allow you to skip adding mvn to the system's path
  • Test with delivery local mode
  • Convert default LWRP to a custom resource
  • Fix readme formatting
  • Use Maven 3.5.0 by default
  • Fix Chef 13 compat + why-run support in settings LWRP

4.0.1 (2016-12-06)

  • Change provider so it only notifies when the artifact actaully changes
  • Add a matcher for the settings resource
  • Set the name property using the DSL
  • Properly set the repositories from attribute in the provider

4.0.0 (2016-09-16)

  • Force update when downloading snapshots
  • Require Chef 12.1+
  • Testing updates

3.0.0 (2016-09-03)

  • Resolve rubocop warnings
  • Add use_inline_resources to the providers
  • Testing updates
  • Use inspec and remove apt cookbook from testing
  • Require Chef 12
  • Remove the Windows cookbook dep which isn't needed in Chef 12

v2.2.0 (2016-04-04)

  • Add timeout value to the maven resource
  • Cleanup to how the default action is set in the maven resource
  • Require a modern Windows cookbook as there are issues with the older releases

v2.1.1 (2016-02-16)

  • Increase the ark version pin to ~1.0 to bring in the last 2 years of ark changes
  • Require the latest java cookbook to fix install issues on Ubuntu/Debian and to support the latest OpenJDK releases
  • Updated all testing dependencies
  • Updated the platforms that are tested in Test Kitchen

v2.1.0 (2015-11-25)

  • Added a new settings LWRP for updating maven settings. See the readme for details
  • Add the group lwrp property to the readme

v2.0.1 (2015-11-16)

  • Added Chefspec matchers
  • Updated the LWRP with a new attribute group that defaults to node['root_group'] which enables support for platforms such as FreeBSD and OS X where root's group is not root.

v2.0.0 (2015-11-16)

BREAKING CHANGES:

  • Support for Maven 2 has been removed. In doing so the attribute structure has been changed. The version attribute now has the complete version string not just the major version. The url and 'checksum' attributes are now top level attributes instead of being under the individual maven versions. See the readme for the up to date attribute structure.
  • Java is no longer installed by this cookbook. Maven 3 requires JRE 8, which may require installing Oracle Java depending on the age of your platform. The user need to handle the installation of Java by using the java cookbook or their own wrapper cookbook.

v1.3.1

NOTE: This will be the last release with Maven 2 support

  • Added requirements section to the readme to clarify what distros are supported and the requirement of Chef 11+
  • Updated .gitignore file
  • Added Chef standard Rubocop config
  • Updated Travis CI testing to use Chef DK
  • Updated Berksfile to 3.x format
  • Removed the version pin on apt in the Berksfile
  • Updated Gemfile with the latest development dependencies
  • Updated contributing and testing docs
  • Added maintainers.md and maintainers.toml files
  • Added Travis and cookbook version badges to the readme
  • Added a Rakefile for simplified testing
  • Added a Chefignore file
  • Resolved Rubocop warnings
  • Added source_url and issues_url to the metadata

v1.3.0

  • Adding Windows support

v1.2.0

  • Adding flag to allow Java not to be managed by cookbook

v1.1.0

  • [COOK-3849] - Update maven 3 to 3.1.1

v1.0.0

Improvement

v0.16.4

Improvement

  • COOK-3352 - Improve repository_root attribute customization

Bug

v0.16.2

The following changes were originally released as 0.16.0, but the README incorrectly referred to the maven# recipes, which are now removed.

Task

  • [COOK-1874]: refactor maven default recipe to use version attributes

Bug

  • [COOK-2770]: maven cookbook broken for maven3 now that maven 3.0.5 has been released

v0.15.0

  • [COOK-1336] - Make Transitive Flag Configurable

v0.14.0

  • [COOK-2191] - maven3 recipe's "version" doesn't match the attributes
  • [COOK-2208] - Add 'classifier' attribute to maven cookbook

v0.13.0

  • [COOK-2116] - maven should be available on the path

v0.12.0

  • [COOK-1860] - refactor maven provider to use resources and shell_out

v0.11.0

  • [COOK-1337] - add put action to maven lwrp to control name of the downloaded file
  • [COOK-1657] - fix download urls

v0.3.0

  • [COOK-1145] - maven lwrp to download artifacts
  • [COOK-1196] - convert lwrp attributes to snake_case
  • [COOK-1423] - check version attribute in default recipe

v0.2.0

  • [COOK-813] - installs maven2 and maven3 using the binaries from maven.apache.org

Collaborator Number Metric
            

5.2.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric
            

5.2.0 passed this metric

Foodcritic Metric
            

5.2.0 passed this metric

No Binaries Metric
            

5.2.0 passed this metric

Testing File Metric
            

5.2.0 passed this metric

Version Tag Metric
            

5.2.0 passed this metric