#-*- mode: ruby -*-
warn "ruby-maven is running fixed JRuby version #{JRUBY_VERSION}"

# tell the gem setup for maven where the java sources are
# and how to name the jar file (default path for the jar: ./lib )
gemspec( :jar => 'warbler_jar.jar',
         :source => 'ext' )

properties(
  'project.build.sourceEncoding' => 'UTF-8',
  'mavengem.wagon.version' => '2.0.3',
  'jruby.plugins.version' => '3.0.6',
  'jetty.version' => '9.4.58.v20250814',
)

# dependencies needed for compilation
scope :provided do
  jar 'org.jruby:jruby', '${jruby.version}'
  jar 'org.eclipse.jetty:jetty-webapp', '${jetty.version}'
end

plugin :clean, '3.5.0'
plugin :compiler, '3.15.0', :release => '8'
plugin :resources, '3.5.0'
plugin :jar, '3.5.0' do
  execute_goals(:phase => 'none') # Avoid a duplicate execution with that defined by the :gemspec directive
end
plugin :install, '3.1.4'

gem 'bundler', '${bundler.version}'
gem 'jruby-jars', '${jruby.version}'

plugin :invoker, '3.10.1' do
  execute_goals( :install, :run,
                 :id => 'integration-test',
                 :properties => {
                   'warbler.version' => '${project.version}',
                   'jruby.version' => '${jruby.version}',
                   'jetty.version' => '${jetty.version}',
                   'bundler.version' => '${bundler.version}',
                   'jruby.plugins.version' => '${jruby.plugins.version}',
                   'style.color' => 'always',
                 },
                 :goals => ['verify'],
                 :projectsDirectory => 'integration',
                 :pomIncludes => [ '*/pom.xml' ],
                 :pomExcludes => [],
                 :streamLogs => true )
end
