Giter Site home page Giter Site logo

namtzigla / maven Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sous-chefs/maven

0.0 2.0 0.0 168 KB

Development repository for maven Chef Cookbook

Home Page: https://supermarket.chef.io/cookbooks/maven

License: Apache License 2.0

Ruby 99.43% HTML 0.57%

maven's Introduction

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 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.

Requirements

Platforms

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

Chef

  • Chef 12+

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

  • 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

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 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, :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 ([email protected])

Author: Bryan W. Berry ([email protected])

Author: Leif Madsen ([email protected])

Copyright: 2008-2016, 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's People

Contributors

tas50 avatar bryanwb avatar sethvargo avatar maoo avatar martinei avatar gildegoma avatar nathenharvey avatar schisamo avatar dysinger avatar treyhyde avatar bdols avatar cevou avatar dluchinienoc avatar erichelgeson avatar namtzigla avatar iandelahorne avatar jlandahl avatar fapiko avatar praste avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.