project :name => 'my name', :url => 'example.com' do
model_version '1.0.1'
parent( :group_id => 'example',
:artifact_id => 'parent',
:version => '1.1',
:relative_path => '../pom.xml' )
id( :group_id => 'example',
:artifact_id => 'project',
:version => '1.1' )
packaging 'jar'
description 'some description'
inception_year 2020
organization :name => 'ngo', :url => 'ngo.org'
license( :name => 'AGPL',
:url => 'gnu.org/agpl',
:distribution => 'online',
:comments => 'should be used more often' )
developer( :id => '1',
:name => 'first',
:url => 'example.com/first',
:email => 'first@example.com',
:organization => 'orga',
:organization_url => 'example.org',
:roles => [ 'developer', 'architect' ],
:timezone => 'IST',
:properties => { :gender => :male } )
contributor( :name => 'first',
:url => 'example.com/first',
:email => 'first@example.com',
:organization => 'orga',
:organization_url => 'example.org',
:roles => [ 'developer', 'architect' ],
:timezone => 'IST',
:properties => { :gender => :male } )
mailing_list( :name => 'development',
:subscribe => 'subcribe@example.com',
:unsubscribe => 'unsubcribe@example.com',
:post => 'post@example.com',
:archive => 'example.com/archive',
:other_archives => [ 'example.com/archive1',
'example.com/archive2' ] )
prerequisites :maven => '3.0.5'
modules 'part1', 'part2'
scm( :connection => 'scm:git:git://github.com/torquebox/maven-tools.git',
:developer_connection => 'scm:git:ssh://git@github.com/torquebox/maven-tools.git',
:tag => 'first',
:url => 'http://github.com/torquebox/maven-tools' )
issue_management( :system => 'jira',
:url => 'https://issues.sonatype.org/' )
ci_management( :system => 'travis',
:url => 'travis-ci.org/jruby/jruby' ) do
notifier( :type => 'email',
:address => 'mail2@example.com' )
notifier( :type => 'email',
:send_on_error => true,
:send_on_failure => false,
:send_on_success =>true,
:send_on_warning => false,
:address => 'mail@example.com',
:configuration => { :key1 => 'value1',
:key2 => 'value2' } )
end
distribution( :status => 'active',
:download_url => 'http://dev.example.com/downloads' ) do
repository( :id => 'first',
:name => 'First',
:url => 'http://repo.example.com',
:layout => 'legacy' ) do
releases( :enabled => true,
:update_policy => 'daily',
:checksum_policy => :strict )
snapshots( :enabled => false,
:update_policy => :never,
:checksum_policy => 'none' )
end
snapshot_repository( :id => 'snapshots',
:name => 'First Snapshots',
:url => 'http://snaphots.example.com',
:layout => 'legacy' ) do
releases( :enabled => false,
:update_policy => 'daily',
:checksum_policy => :strict )
snapshots( :enabled =>true,
:update_policy => :never,
:checksum_policy => 'none' )
end
site( :id => 'first',
:name => 'dev site',
:url => 'http://dev.example.com' )
relocation( :group_id => 'org.group',
:artifact_id => 'artifact',
:version => '1.2.3',
:message => 'follow the maven convention' )
end
properties :key1 => 'value1', 'key2' => :value2
dependency_management do
jar( :group_id => 'com.example',
:artifact_id => 'tools',
:version => '1.2.3',
:classifier => 'super',
:scope => 'provided',
:system_path => '/home/development/tools.jar',
:exclusions => [ { :group_id => 'org.example',
:artifact_id => 'some' },
{ :group_id => 'org.example',
:artifact_id => 'something' } ],
:optional => true )
end
war( :group_id => 'com.example',
:artifact_id => 'tools',
:version => '2.3',
:classifier => 'super',
:scope => 'provided',
:system_path => '/home/development/wartools.jar',
:exclusions => [ { :group_id => 'org.example',
:artifact_id => 'some' },
{ :group_id => 'org.example',
:artifact_id => 'something' } ],
:optional => false )
repository( :id => 'first',
:url => 'http://repo.example.com',
:name => 'First',
:layout => 'legacy' ) do
releases( :enabled => true,
:update_policy => 'daily',
:checksum_policy => :strict )
snapshots( :enabled => false,
:update_policy => :never,
:checksum_policy => 'none' )
end
snapshot_repository( :id => 'snapshots',
:url => 'http://snaphots.example.com',
:name => 'First Snapshots',
:layout => 'legacy' ) do
releases( :update_policy => 'daily',
:checksum_policy => :strict )
snapshots( :update_policy => :never,
:checksum_policy => 'none' )
end
plugin_repository( :id => :first,
:url => 'http://pluginrepo.example.com',
:name => 'First',
:layout => 'legacy' ) do
releases( :enabled => true,
:update_policy => 'daily',
:checksum_policy => :strict )
snapshots( :enabled => false,
:update_policy => :never,
:checksum_policy => 'none' )
end
build do
directory 'target'
final_name 'myproject'
source_directory 'src'
script_source_directory 'script'
test_source_directory 'test'
output_directory 'pkg'
test_output_directory 'pkg/test'
default_goal :deploy
extension( :group_id => 'org.group',
:artifact_id => 'gem-extension',
:version => '1.2' )
resource( :target_path => 'target',
:filtering => true,
:directory => 'resources',
:includes => [ '**/*' ],
:excludes => [ '*~' ] )
test_resource( :target_path => 'target/test',
:filtering => false,
:directory => 'testresources',
:includes => [ '**/*' ],
:excludes => [ '*~' ] )
plugin( :jar, '1.0',
:inherited => false,
:extensions => true,
:finalName => :testing )
jruby_plugin :gem, '1.0.0', 'extensions' => false do
gem :bundler, '1.7.13'
end
plugin :antrun do
execute_goals( 'run',
:id => 'copy',
:phase => 'package',
'tasks' => {
'exec' => {
'@executable' => '/bin/sh',
'@osfamily' => 'unix',
'arg' => {
'@line' => '-c \'cp "${jruby.basedir}/bin/jruby.bash" "${jruby.basedir}/bin/jruby"\''
}
},
'chmod' => {
'@file' => '${jruby.basedir}/bin/jruby',
'@perm' => '755'
}
} )
jar 'org.super.duper:executor:1.0.0'
end
plugin 'org.codehaus.mojo:exec-maven-plugin' do
execute_goal( 'exec',
:id => 'invoker-generator',
:arguments => [ '-Djruby.bytecode.version=${base.java.version}',
'-classpath',
xml( '' ),
'org.jruby.anno.InvokerGenerator',
'${anno.sources}/annotated_classes.txt',
'${project.build.outputDirectory}' ],
:executable => 'java',
:classpath_scope => 'compile' )
end
plugin_management do
jruby_plugin( :gem, '1.1.5', :scope => :compile,
:gems => {
'thread_safe' => '0.3.3',
'jdbc-mysql' => '5.1.30'
} )
plugin( "org.mortbay.jetty:jetty-maven-plugin:8.1",
:path => '/',
:connectors => [ { :@implementation => "org.eclipse.jetty.server.nio.SelectChannelConnector",
:port => '${run.port}' },
{ :@implementation => "org.eclipse.jetty.server.ssl.SslSelectChannelConnector",
:port => '${run.sslport}',
:keystore => '${run.keystore}',
:key_password => '${run.keystore.pass}',
:trust_password => '${run.truststore.pass}' } ],
:http_connector => { :port => '${run.port}' } )
end
end
profile :id => 'one' do
activation do
active_by_default false
jdk '1.7'
os :family => 'nix', :version => '2.7', :arch => 'x86_64', :name => 'linux'
file :missing => 'required_file', :exists => 'optional'
property :name => 'test', :value => 'extended'
end
end
end
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
# value
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#