Skip to content

Commit 802053e

Browse files
authored
Merge pull request #42 from chadlwilson/patch-1
Correct usage of maven-tools under JRuby 10.0.3+ and Ruby 4.0
2 parents ca7e7fe + 6dfe41a commit 802053e

File tree

84 files changed

+920
-653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+920
-653
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ on:
99

1010
jobs:
1111
ci:
12-
runs-on: ubuntu-24.04
12+
runs-on: ubuntu-latest
1313

1414
strategy:
1515
fail-fast: false
1616

1717
matrix:
18-
ruby: [jruby-9.4.9.0, 3.3]
19-
java: [8]
18+
ruby: ['jruby-10', 'jruby-9.4', '4.0', '3.4', '3.3']
19+
java: [8, 25]
20+
exclude:
21+
- ruby: 'jruby-10' # JRuby 10 requires Java 21+
22+
java: 8
2023

2124
steps:
2225
- name: checkout
23-
uses: actions/checkout@v2
26+
uses: actions/checkout@v5
2427

2528
- name: Set up java
26-
uses: actions/setup-java@v2
29+
uses: actions/setup-java@v5
2730
with:
28-
distribution: zulu
2931
java-version: ${{ matrix.java }}
32+
distribution: 'temurin'
33+
cache: maven
3034

3135
- name: Set up ruby
3236
uses: ruby/setup-ruby@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ Gemfile.lock
55
*.gem
66
.ruby-version
77
pom.maven-tools.gemspec.xml
8+
.idea

.mvn/wrapper/maven-wrapper.jar

-48.3 KB
Binary file not shown.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
1+
wrapperVersion=3.3.4
2+
distributionType=only-script
3+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.12/apache-maven-3.9.12-bin.zip

Gemfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,4 @@ source 'https://rubygems.org'
33

44
gemspec
55

6-
gem "copyright-header", "1.0.8", :platform => :mri, :group => :copyright
7-
86
# vim: syntax=Ruby

Rakefile

Lines changed: 9 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
#-*- mode: ruby -*-
2-
32
task :default => [ :specs ]
43

54
desc 'generate licenses data from internet'
65
task :licenses do
76
require 'open-uri'
8-
require 'ostruct'
9-
7+
require 'json'
8+
109
File.open( 'lib/maven/tools/licenses.rb', 'w' ) do |f|
11-
url = 'http://opensource.org'
12-
f.puts "require 'ostruct'"
10+
url = 'https://opensource.org'
1311
f.puts 'module Maven'
1412
f.puts ' module Tools'
13+
f.puts ' SpdxLicenseMeta = Struct.new(:short, :name, :url, keyword_init: true)'
1514
f.puts ' LICENSES = {}'
1615

17-
open( url + '/licenses/alphabetical' ).each_line do |line|
18-
19-
if line =~ /.*"\/licenses\// and line =~ /<li>/
20-
l = OpenStruct.new
21-
line.sub!( /.*"(\/licenses\/([^"]*))">/ ) do
22-
l.url = "http://opensource.org#{$1}"
23-
l.short = $1.sub( /\/licenses\//, '' )
24-
''
25-
end
26-
line.sub!( /\ \(.*$/, '' )
27-
f.puts " LICENSES[ #{l.short.downcase.inspect} ] = OpenStruct.new :short => #{l.short.inspect}, :name => #{line.strip.inspect}, :url => #{l.url.inspect}"
28-
end
29-
end
16+
JSON.parse(URI.open( url + '/api/licenses' ).read)
17+
.select { |l| l["spdx_id"].size > 0 && l["name"].size > 0 }
18+
.sort_by { |l| l["spdx_id"].downcase }
19+
.each { |l| f.puts(" LICENSES[ #{l["spdx_id"].downcase.inspect} ] = SpdxLicenseMeta.new( short: #{l["spdx_id"].inspect}, name: #{l["name"].inspect}, url: #{l["_links"]["html"]["href"].inspect} ).freeze") }
20+
3021
f.puts ' LICENSES.freeze'
3122
f.puts ' end'
3223
f.puts 'end'
@@ -48,23 +39,4 @@ task :specs do
4839
Dir['spec/**/*_spec.rb'].each { |f| require f.sub(/spec\//, '') }
4940
end
5041

51-
task :headers do
52-
require 'copyright_header'
53-
54-
s = Gem::Specification.load( Dir["*gemspec"].first )
55-
56-
args = {
57-
:license => s.license,
58-
:copyright_software => s.name,
59-
:copyright_software_description => s.description,
60-
:copyright_holders => s.authors,
61-
:copyright_years => [Time.now.year],
62-
:add_path => "lib:src",
63-
:output_dir => './'
64-
}
65-
66-
command_line = CopyrightHeader::CommandLine.new( args )
67-
command_line.execute
68-
end
69-
7042
# vim: syntax=Ruby

lib/maven/tools/dsl.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ def model
4343
@model
4444
end
4545

46-
# TODO remove me
47-
def needs_torquebox= t
48-
end
4946
# TODO remove me
5047
def current
5148
@current

lib/maven/tools/licenses.rb

Lines changed: 115 additions & 71 deletions
Large diffs are not rendered by default.

lib/maven/tools/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
#
2121
module Maven
2222
module Tools
23-
VERSION = '1.2.3'.freeze
23+
VERSION = '1.2.4'.freeze
2424
end
2525
end

lib/maven/tools/versions.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ module Maven
2222
module Tools
2323
unless defined? VERSIONS
2424
VERSIONS = {
25-
:jar_plugin => "2.4",
26-
:clean_plugin => "2.4",
27-
:jruby_plugins => "3.0.0",
25+
:clean_plugin => "3.5.0",
26+
:jar_plugin => "3.5.0",
27+
:jruby_plugins => "3.0.6",
2828
:jruby9_plugins => "0.3.0",
2929
:bundler_version => "1.10.6",
30-
:jruby_version => "9.1.2.0",
31-
:polyglot_version => "0.1.18",
32-
:mavengem_wagon => "2.0.0"
30+
:jruby_version => "9.4.14.0",
31+
:polyglot_version => "0.8.1",
32+
:mavengem_wagon => "2.0.2"
3333
}.freeze
3434
end
3535
end

0 commit comments

Comments
 (0)