Skip to content

Commit bebeec6

Browse files
committed
[build] setup and leverage mvn-wrapper
1 parent 497ed1b commit bebeec6

File tree

5 files changed

+434
-7
lines changed

5 files changed

+434
-7
lines changed

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
cache: maven
3939

4040
- name: Build with Maven
41-
run: mvn -B install -Djruby.version=${{ matrix.jruby_version }}
41+
run: ./mvnw -B install -Djruby.version=${{ matrix.jruby_version }}
4242

4343
# Uploads the full dependency graph to GitHub to improve the quality of Dependabot alerts this repository can receive
4444
- name: Update dependency graph
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
wrapperVersion=3.3.2
18+
distributionType=only-script
19+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.8/apache-maven-3.8.8-bin.zip

Rakefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ directory 'target/classes'
3838

3939
desc "Compile classes"
4040
task(:compile => 'target/classes') do
41-
sh "mvn compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
41+
sh "./mvnw compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
4242
end
4343

4444
directory 'target/test-classes'
4545

4646
desc "Compile test classes"
4747
task(:test_prepare => ['target/classes', 'target/test-classes']) do
48-
sh "mvn test-compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
48+
sh "./mvnw test-compile #{ENV['JRUBY_VERSION'] ? "-Djruby.version=#{ENV['JRUBY_VERSION']}" : ""}"
4949
end
5050

5151
desc "Unpack the rack gem"
@@ -98,7 +98,7 @@ task :test_resources => ["target/test-classes"]
9898
namespace :resources do
9999
desc "Copy (and generate) resources"
100100
task :copy => :resources do
101-
sh 'mvn process-resources -Dmdep.skip=true'
101+
sh './mvnw process-resources -Dmdep.skip=true'
102102
end
103103
desc "Generate test resources"
104104
task :test => :test_resources
@@ -208,7 +208,7 @@ task :release_checks do
208208
" git push origin :#{GEM_VERSION}" if ok
209209
end
210210

211-
pom_version = `mvn help:evaluate -Dexpression=project.version`.
211+
pom_version = `./mvnw help:evaluate -Dexpression=project.version`.
212212
split("\n").reject { |line| line =~ /[INFO]/ }.first.chomp
213213
if pom_version =~ /dev|SNAPSHOT/
214214
fail "Can't release a dev/snapshot version.\n" +
@@ -218,7 +218,7 @@ task :release_checks do
218218
unless pom_version.sub(/\-(\D+\w*)/, '.\1') == GEM_VERSION
219219
fail "Can't release because pom.xml version (#{pom_version}) is different than " +
220220
"jruby/rack/version.rb (#{GEM_VERSION}).\n" +
221-
"Please run `mvn install' to bring the two files in sync."
221+
"Please run `./mvnw install' to bring the two files in sync."
222222
end
223223

224224
puts "release #{GEM_VERSION} looks ready to go ..."
@@ -229,7 +229,7 @@ task :release => [:release_checks, :clean] do
229229
args = ''
230230
args << "-Dgpg.keyname=#{ENV['GPG_KEYNAME']} " if ENV['GPG_KEYNAME']
231231

232-
sh "mvn -Prelease #{args} -DupdateReleaseInfo=true clean deploy"
232+
sh "./mvnw -Prelease #{args} -DupdateReleaseInfo=true clean deploy"
233233

234234
sh "git tag #{GEM_VERSION}"
235235

mvnw

Lines changed: 259 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)