在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):maestrodev/puppet-maven开源软件地址(OpenSource Url):https://github.com/maestrodev/puppet-maven开源编程语言(OpenSource Language):Ruby 69.7%开源软件介绍(OpenSource Introduction):Puppet-MavenA Puppet recipe for Apache Maven, to download artifacts from a Maven repository Uses Apache Maven command line to download the artifacts. Building and Installing the ModuleTo build the module for installing in your Puppet master: gem install puppet-module
git clone git://github.com/maestrodev/puppet-maven.git
cd puppet-maven
puppet module build
puppet module install pkg/maestrodev-maven-1.0.1.tar.gz Of course, you can also clone the repository straight into Developing and Testing the ModuleIf you are developing the module, it can be built using gem install bundler
bundle
rake spec Acceptance testsUsing Puppetlabs Beaker. To run the default Vagrant box in CentOS 6.5 just do
To run any other box, check the definitions at
Usage maven { "/tmp/myfile":
id => "groupId:artifactId:version:packaging:classifier",
repos => ["id::layout::http://repo.acme.com","http://repo2.acme.com"],
} or maven { "/tmp/myfile":
groupid => "org.apache.maven",
artifactid => "maven-core",
version => "3.2.5",
packaging => "jar",
classifier => "sources",
repos => ["id::layout::http://repo.acme.com","http://repo2.acme.com"],
} ensure
MAVEN_OPTS PrecedenceValues set in If you would prefer these options to win, instead use: maven_opts => "",
mavenrc_additions => 'MAVEN_OPTS="$MAVEN_OPTS -Xmx1024m" ExamplesSetup $central = {
id => "myrepo",
username => "myuser",
password => "mypassword",
url => "http://repo.acme.com",
mirrorof => "external:*", # if you want to use the repo as a mirror, see maven::settings below
}
$proxy = {
active => true, #Defaults to true
protocol => 'http', #Defaults to 'http'
host => 'http://proxy.acme.com',
username => 'myuser', #Optional if proxy does not require
password => 'mypassword', #Optional if proxy does not require
nonProxyHosts => 'www.acme.com', #Optional, provides exceptions to the proxy
}
# Install Maven
class { "maven::maven":
version => "3.2.5", # version to install
# you can get Maven tarball from a Maven repository instead than from Apache servers, optionally with a user/password
repo => {
#url => "http://repo.maven.apache.org/maven2",
#username => "",
#password => "",
}
} ->
# Setup a .mavenrc file for the specified user
maven::environment { 'maven-env' :
user => 'root',
# anything to add to MAVEN_OPTS in ~/.mavenrc
maven_opts => '-Xmx1384m', # anything to add to MAVEN_OPTS in ~/.mavenrc
maven_path_additions => "", # anything to add to the PATH in ~/.mavenrc
} ->
# Create a settings.xml with the repo credentials
maven::settings { 'maven-user-settings' :
mirrors => [$central], # mirrors entry in settings.xml, uses id, url, mirrorof from the hash passed
servers => [$central], # servers entry in settings.xml, uses id, username, password from the hash passed, privateKey
proxies => [$proxy], # proxies entry in settings.xml, active, protocol, host, username, password, nonProxyHosts
user => 'maven',
}
# defaults for all maven{} declarations
Maven {
user => "maven", # you can make puppet run Maven as a specific user instead of root, useful to share Maven settings and local repository
group => "maven", # you can make puppet run Maven as a specific group
repos => "http://repo.maven.apache.org/maven2"
} Downloading artifacts maven { "/tmp/maven-core-3.2.5.jar":
id => "org.apache.maven:maven-core:3.2.5:jar",
repos => ["central::default::http://repo.maven.apache.org/maven2","http://mirrors.ibiblio.org/pub/mirrors/maven2"],
}
maven { "/tmp/maven-core-3.2.5-sources.jar":
groupid => "org.apache.maven",
artifactid => "maven-core",
version => "3.2.5",
classifier => "sources",
} Buildr versionInitially there was an Apache Buildr version, but it required to have Buildr installed before running Puppet and you would need to enable pluginsync in both master and clients. License
AuthorCarlos Sanchez [email protected] MaestroDev 2010-03-01 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论