cookbook 'maven', '= 2.0.1', :supermarket
Installs Apache Maven includes a resource for installing artifacts from maven
cookbook 'maven', '= 2.0.1'
knife cookbook site install maven
knife cookbook site download maven
Install and configure Apache Maven from the binaries provided by the Maven project.
maven LWRP for pulling a maven artifact from a mave repository and placing it in an arbitrary location.
Note: This cookbook does not handle the installation of Java, but Maven requires a working JDK 8 release. You'll need to use the Java cookbook to install OpenJDK or Oracle's JRE depending on your platform.
- Chef 11+
- java - java_ark LWRP used by the Maven LWRP
- 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 <file>
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
Installs maven according to the version specified by the
Install a working Java 8 JRE (Oracle or OpenJDK) either using the Java cookbook or your own cookbooks
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.
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
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.
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 (firstname.lastname@example.org)
Author: Bryan W. Berry (email@example.com)
Author: Leif Madsen (firstname.lastname@example.org)
Copyright: 2008-2015, 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.
maven Cookbook CHANGELOG
This file is used to list changes made in each version of the maven cookbook.
- Added Chefspec matchers
- Updated the LWRP with a new attribute
groupthat defaults to node['root_group'] which enables support for platforms such as FreeBSD and OS X where root's group is not root.
* 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.
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
- Adding Windows support
- Adding flag to allow Java not to be managed by cookbook
- [COOK-3849] - Update maven 3 to 3.1.1
- COOK-3352 - Improve
- COOK-2799 - Fix idempotency in LWRP
The following changes were originally released as 0.16.0, but the README incorrectly referred to the maven# recipes, which are now removed.
- [COOK-1874]: refactor maven default recipe to use version attributes
- [COOK-2770]: maven cookbook broken for maven3 now that maven 3.0.5 has been released
- [COOK-1336] - Make Transitive Flag Configurable
- [COOK-2191] - maven3 recipe's "version" doesn't match the attributes
- [COOK-2208] - Add 'classifier' attribute to maven cookbook
- [COOK-2116] - maven should be available on the path
- [COOK-1860] - refactor maven provider to use resources and
- [COOK-1337] - add put action to maven lwrp to control name of the downloaded file
- [COOK-1657] - fix download urls
- [COOK-1145] - maven lwrp to download artifacts
- [COOK-1196] - convert lwrp attributes to snake_case
- [COOK-1423] - check version attribute in default recipe
- [COOK-813] - installs maven2 and maven3 using the binaries from maven.apache.org
2.0.1 passed this metric
2.0.1 passed this metric