Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

maven2 recipe now works

  • Loading branch information...
commit d2808cafca6a5aa3e3e18becdba1efb16dfb02dd 1 parent 17f54dc
@bryanwb authored
View
2  attributes/default.rb
@@ -6,4 +6,6 @@
default['maven']['version'] = 2
default['maven']['m2_home'] = '/usr/local/maven/'
default['maven']['m2_download_url'] = "http://www.apache.org/dist//maven/binaries/apache-maven-2.2.1-bin.tar.gz"
+default['maven']['m2_checksum'] = "b9a36559486a862abfc7fb2064fd1429f20333caae95ac51215d06d72c02d376"
default['maven']['m3_download_url'] = 'http://www.apache.org/dist/maven/binaries/apache-maven-3.0.3-bin.tar.gz'
+default['maven']['m3_checksum'] = "4fb4a392d879ebcd19dc5a05f9d779aed7f1e3356c8c9e6200b15f8b6e1f85e0"
View
2  metadata.rb
@@ -5,7 +5,7 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.0.2"
-%w{ java jpackage }.each do |cb|
+%w{ java }.each do |cb|
depends cb
end
View
28 recipes/maven2-src.rb
@@ -1,8 +1,8 @@
#
# Cookbook Name:: maven
-# Recipe:: default
+# Recipe:: maven3-src
#
-# Copyright 2010, Opscode, Inc.
+# Copyright 2011, Bryan W. Berry (<bryan.berry@gmail.com>)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -19,26 +19,30 @@
include_recipe "java"
-remote_file "maven3_src" do
- path "/tmp"
- source node['maven']['m3_download_url']
- checksum "4fb4a392d879ebcd19dc5a05f9d779aed7f1e3356c8c9e6200b15f8b6e1f85e0"
+remote_file "/tmp/apache-maven.tar.gz" do
+ source node['maven']['m2_download_url']
+ checksum node['maven']['m2_checksum']
end
-bash "install_maven3" do
+directory node['maven']['m2_home']
+
+bash "install_maven2" do
+ folder_name = node['maven']['m2_download_url'].split('/')[-1].split('-bin.tar.gz')[0]
+ puts folder_name
cwd "/tmp"
user "root"
code <<-EOH
+ tar xvzf apache-maven.tar.gz
+ cp -r #{folder_name}/* #{node['maven']['m2_home']}
+ rm -rf apache-maven.tar.gz #{folder_name}
EOH
end
-
template "/etc/mavenrc" do
-
+ source "mavenrc.erb"
+ mode "0755"
end
-
link "/usr/bin/mvn" do
-
-
+ to "#{node['maven']['m2_home']}bin/mvn"
end
View
2  recipes/maven3-src.rb
@@ -21,7 +21,7 @@
remote_file "/tmp/apache-maven.tar.gz" do
source node['maven']['m3_download_url']
- checksum "4fb4a392d879ebcd19dc5a05f9d779aed7f1e3356c8c9e6200b15f8b6e1f85e0"
+ checksum node['maven']['m3_checksum']
end
directory node['maven']['m2_home']
Please sign in to comment.
Something went wrong with that request. Please try again.