forked from jruby/jruby
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpom.rb
81 lines (71 loc) · 3.09 KB
/
pom.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
require 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new File.new(File.join(File.dirname(__FILE__),'..', '..', 'pom.xml'))
version = REXML::XPath.first(doc, "//project/version").text
project 'JRuby Main Maven Artifact' do
model_version '4.0.0'
id "org.jruby:jruby:#{version}"
inherit "org.jruby:jruby-artifacts:#{version}"
packaging 'jar'
properties( 'tesla.dump.pom' => 'pom-generated.xml',
'jruby.basedir' => '${basedir}/../../',
'main.basedir' => '${project.parent.parent.basedir}' )
jar 'org.jruby:jruby-core:${project.version}'
jar 'org.jruby:jruby-stdlib:${project.version}'
plugin( :source,
'skipSource' => 'true' )
plugin 'org.codehaus.mojo:build-helper-maven-plugin' do
execute_goals( 'attach-artifact',
:id => 'attach-artifacts',
:phase => 'package',
'artifacts' => [ { 'file' => '${basedir}/src/empty.jar',
'classifier' => 'sources' },
{ 'file' => '${basedir}/src/empty.jar',
'classifier' => 'javadoc' } ] )
end
execute 'setup other osgi frameworks', :phase => 'pre-integration-test' do |ctx|
felix = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_all_inclusive' )
[ 'equinox-3.6', 'equinox-3.7', 'felix-3.2'].each do |m|
target = File.join( ctx.basedir.to_pathname, 'src', 'it', 'osgi_all_inclusive_' + m )
FileUtils.cp_r( felix, target )
File.open( File.join( target, 'invoker.properties' ), 'w' ) do |f|
f.puts 'invoker.profiles = ' + m
end
end
end
plugin( :invoker,
'projectsDirectory' => 'src/it',
'cloneProjectsTo' => '${project.build.directory}/it',
'preBuildHookScript' => 'setup.bsh',
'postBuildHookScript' => 'verify.bsh',
'goals' => [ 'install' ] ) do
execute_goals( 'install', 'run',
:id => 'integration-test',
'settingsFile' => '${basedir}/src/it/settings.xml',
'localRepositoryPath' => '${project.build.directory}/local-repo' )
end
profile :id => :jdk8 do
activation do
jdk '1.8'
end
plugin :invoker, :pomExcludes => ['osgi_all_inclusive_felix-3.2/pom.xml']
end
profile :id => :jdk6 do
activation do
jdk '1.6'
end
plugin :invoker, :pomExcludes => ['jetty/pom.xml','j2ee_jetty/pom.xml','j2ee_wildfly/pom.xml']
end
profile :id => :wlp do
activation do
property :name => 'wlp.jar'
end
execute :install_wlp, :phase => :'pre-integration-test' do |ctx|
wlp = ctx.project.properties[ 'wlp.jar' ] || java.lang.System.properties[ 'wlp.jar' ]
system( 'java -jar ' + wlp.to_pathname + ' --acceptLicense ' + ctx.project.build.directory.to_pathname )
system( File.join( ctx.project.build.directory.to_pathname,
'wlp/bin/server' ) + 'create testing' )
FileUtils.cp_r( File.join( ctx.basedir.to_pathname, 'src/templates/j2ee_wlp'), File.join( ctx.basedir.to_pathname, 'src/it' ) )
end
end
end