Skip to content

Commit cd0ae73

Browse files
committed
build: use ./mvnw -ntp consistently in automation
It's not great practice to be mix+matching mvn and mvnw; since it risks inconsistency. When Maven 4 comes out this practice will cause headaches :-) Signed-off-by: Chad Wilson <29788154+chadlwilson@users.noreply.github.com>
1 parent cbdbb56 commit cd0ae73

11 files changed

Lines changed: 48 additions & 51 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
java-version: ${{ matrix.java-version }}
3434
cache: 'maven'
3535
- name: bootstrap
36-
run: mvn -ntp -Pbootstrap clean package
36+
run: ./mvnw -ntp -Pbootstrap clean package
3737
- name: bundle install
3838
run: bin/jruby --dev -S bundle install
3939
- name: rake ${{ matrix.target }}
@@ -61,7 +61,7 @@ jobs:
6161
java-version: ${{ matrix.java-version }}
6262
cache: 'maven'
6363
- name: bootstrap
64-
run: mvn -ntp -Pbootstrap clean package
64+
run: ./mvnw -ntp -Pbootstrap clean package
6565
- name: bundle install
6666
run: bin/jruby --dev -S bundle install
6767
- name: rake ${{ matrix.target }}
@@ -87,7 +87,7 @@ jobs:
8787
java-version: 21
8888
cache: 'maven'
8989
- name: bootstrap
90-
run: mvn -ntp -Pbootstrap clean package
90+
run: ./mvnw -ntp -Pbootstrap clean package
9191
- name: bundle install
9292
run: bin/jruby --dev -S bundle install
9393
- name: run specs
@@ -116,7 +116,7 @@ jobs:
116116
java-version: 21
117117
cache: 'maven'
118118
- name: bootstrap
119-
run: mvn -ntp -Pbootstrap clean package
119+
run: ./mvnw -ntp -Pbootstrap clean package
120120
- name: bundle install
121121
run: bin/jruby --dev -S bundle install
122122
- name: rake test:jruby
@@ -148,7 +148,7 @@ jobs:
148148
java-version: ${{ matrix.java-version }}
149149
cache: 'maven'
150150
- name: bootstrap
151-
run: mvn -ntp -Pbootstrap clean package
151+
run: ./mvnw -ntp -Pbootstrap clean package
152152
- name: bundle install
153153
run: bin/jruby --dev -S bundle install
154154
- name: rake ${{ matrix.target }}
@@ -177,7 +177,7 @@ jobs:
177177
java-version: ${{ matrix.java-version }}
178178
cache: 'maven'
179179
- name: bootstrap
180-
run: mvn -ntp -Pbootstrap clean package
180+
run: ./mvnw -ntp -Pbootstrap clean package
181181
- name: bundle install
182182
run: bin/jruby --dev -S bundle install
183183
- name: mvn package ${{ matrix.package-flags }}
@@ -209,7 +209,7 @@ jobs:
209209
java-version: ${{ matrix.java-version }}
210210
cache: 'maven'
211211
- name: bootstrap
212-
run: mvn -ntp -Pbootstrap clean package
212+
run: ./mvnw -ntp -Pbootstrap clean package
213213
- name: bundle install
214214
run: bin/jruby --dev -S bundle install
215215
- name: mvn package ${{ matrix.package-flags }}
@@ -238,7 +238,7 @@ jobs:
238238
java-version: 21
239239
cache: 'maven'
240240
- name: bootstrap
241-
run: mvn -ntp -Pbootstrap clean package
241+
run: ./mvnw -ntp -Pbootstrap clean package
242242
- name: bundle install
243243
run: bin/jruby --dev -S bundle install
244244
- name: rake spec:regression
@@ -266,15 +266,15 @@ jobs:
266266
java-version: 21
267267
cache: 'maven'
268268
- name: bootstrap
269-
run: mvn -ntp -Pbootstrap clean package
269+
run: ./mvnw -ntp -Pbootstrap clean package
270270
- name: bundle install
271271
run: bin/jruby --dev -S bundle install
272272
- name: rake test:jruby
273273
run: bin/jruby -S rake test:jruby TESTOPTS="--no-show-detail-immediately"
274274
env:
275275
JRUBY_OPTS: ''
276276
- name: mvn -P test
277-
run: ./mvnw package -B -Ptest
277+
run: ./mvnw -ntp package -Ptest
278278

279279
spec-ruby-language-windows:
280280
runs-on: windows-latest
@@ -298,7 +298,7 @@ jobs:
298298
java-version: 21
299299
cache: 'maven'
300300
- name: bootstrap
301-
run: mvn -ntp -Pbootstrap clean package
301+
run: ./mvnw -ntp -Pbootstrap clean package
302302
- name: bundle install
303303
run: bin/jruby --dev -S bundle install
304304
- name: language specs interpreted
@@ -330,7 +330,7 @@ jobs:
330330
java-version: 21
331331
cache: 'maven'
332332
- name: bootstrap
333-
run: mvn -ntp -Pbootstrap clean package
333+
run: ./mvnw -ntp -Pbootstrap clean package
334334
- name: bundle install
335335
run: bin/jruby --dev -S bundle install
336336
- name: core specs interpreted
@@ -424,7 +424,7 @@ jobs:
424424
java-version: 21
425425
cache: 'maven'
426426
- name: bootstrap
427-
run: mvn -ntp -Pbootstrap clean package
427+
run: ./mvnw -ntp -Pbootstrap clean package
428428
- name: bundle install
429429
run: bin/jruby --dev -S bundle install
430430
- name: sequel
@@ -448,7 +448,7 @@ jobs:
448448
java-version: 21
449449
cache: 'maven'
450450
- name: bootstrap
451-
run: mvn -ntp -Pbootstrap clean package
451+
run: ./mvnw -ntp -Pbootstrap clean package
452452
- name: bundle install
453453
run: bin/jruby --dev -S bundle install
454454
- name: concurrent-ruby
@@ -526,7 +526,7 @@ jobs:
526526
java-version: '21'
527527
cache: 'maven'
528528
- name: bootstrap
529-
run: mvn -ntp -Pbootstrap clean package
529+
run: ./mvnw -ntp -Pbootstrap clean package
530530
- name: bundle install
531531
run: bin/jruby -S bundle install
532532
- name: test profile

.github/workflows/dist-verification-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
cache: 'maven'
3232
- name: build dist archive
3333
run: |
34-
mvn -ntp clean package -Pdist
34+
./mvnw -ntp clean package -Pdist
3535
mv maven/jruby-dist/target/jruby-dist*-bin.tar.gz jruby-dist-bin.tar.gz
3636
- name: cache dist
3737
uses: actions/upload-artifact@v4

.github/workflows/snapshot-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
server-username: MAVEN_USERNAME
3434
server-password: MAVEN_PASSWORD
3535
- name: Publish package
36-
run: ./mvnw -B clean deploy -Psnapshots
36+
run: ./mvnw -ntp clean deploy -Psnapshots
3737
env:
3838
MAVEN_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
3939
MAVEN_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}

BUILDING.md

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Prerequisites:
55

66
* A [Java 21-compatible (or higher) Java development kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
77
* If `JAVA_HOME` is not set on Mac OS X: `export JAVA_HOME=$(/usr/libexec/java_home)`
8-
* [Maven](https://maven.apache.org/download.cgi) 3.3.0+ (Maven Wrapper provided with `./mvnw`)
98

109
For running tests, you will need Ant:
1110

@@ -25,21 +24,19 @@ command to execute is:
2524
./mvnw
2625
```
2726

28-
This will run the default "install" goal (`mvn install`) and will do all of the following:
27+
This will run the default "install" goal (`./mvnw install`) and will do all of the following:
2928

3029
* Compile JRuby
3130
* Build `lib/jruby.jar`, needed for running at command line
3231
* It will install the default gems specifications `lib/pom.rb` and the ruby files of those gems in `lib/ruby/stdlib/`.
3332

3433
The environment is now suitable for running Ruby applications.
3534

36-
If you have Maven installed in your PATH, you can just use `mvn` instead of `./mvnw`.
37-
3835
Incremental Builds
3936
------------------
4037

4138
When working on JRuby sources, it is helpful to incrementally rebuild only the `lib/jruby.jar` file rather than also
42-
re-assembling the standard library. You can add `-Dcore` to the `mvn` command line to speed up incremental builds:
39+
re-assembling the standard library. You can add `-Dcore` to the `./mvnw` command line to speed up incremental builds:
4340

4441
```
4542
./mvnw -Dcore
@@ -92,7 +89,7 @@ environment. This will do the following:
9289
needed to run integration tests.
9390

9491
```
95-
mvn -Pbootstrap
92+
./mvnw -Pbootstrap
9693
```
9794

9895
In case there is a problem with installing the jruby-launcher (due to missing compiler or so) use
@@ -110,7 +107,7 @@ After changing Java code, you can recompile quickly by running one of the
110107
jar files by
111108

112109
```
113-
mvn -pl core
110+
./mvnw -pl core
114111
```
115112

116113
### Day to Day Testing
@@ -160,7 +157,7 @@ Most of the specs under the spec/ directory are written for rspec, and can be ru
160157

161158
The notable exception is the "Ruby specs" under spec/ruby, which are run with mspec as described later in this document.
162159

163-
rspec will be installed with `mvn package -Pbootstrap` or you can install it manually.
160+
rspec will be installed with `./mvnw package -Pbootstrap` or you can install it manually.
164161

165162
```
166163
./bin/jruby -S rspec spec/path/to/spec
@@ -193,17 +190,17 @@ If you are making changes that would affect JRuby's core runtime
193190
or embedding APIs, you should run JRuby's Java-based unit tests via
194191

195192
```
196-
mvn -Ptest
193+
./mvnw -Ptest
197194
```
198195

199196
#### Tests for other ways of deploying and packaging JRuby
200197

201198
There are some maven integration tests (i.e. consistency test if all gems are included, osgi test, etc) for the various distributions of JRuby which can be invoked with
202199

203200
```
204-
mvn -Pmain -Dinvoker.skip=false
205-
mvn -Pcomplete -Dinvoker.skip=false
206-
mvn -Pdist -Dinvoker.skip=false
201+
./mvnw -Pmain -Dinvoker.skip=false
202+
./mvnw -Pcomplete -Dinvoker.skip=false
203+
./mvnw -Pdist -Dinvoker.skip=false
207204
```
208205

209206
#### Just Like CI
@@ -224,18 +221,18 @@ maven/jruby-dist/src/it
224221
To trigger the tests with the build:
225222

226223
```
227-
mvn -Pmain -Dinvoker.skip=false
228-
mvn -Pcomplete -Dinvoker.skip=false
229-
mvn -Pdist -Dinvoker.skip=false
230-
mvn -Pjruby-jars -Dinvoker.skip=false
224+
./mvnw -Pmain -Dinvoker.skip=false
225+
./mvnw -Pcomplete -Dinvoker.skip=false
226+
./mvnw -Pdist -Dinvoker.skip=false
227+
./mvnw -Pjruby-jars -Dinvoker.skip=false
231228
```
232229

233230
To pick a particular test, add the name of the directory inside the respective *src/it* folder, like (wildcards are possible):
234231

235232
```
236-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=integrity
237-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=j2ee*
238-
mvn -Pmain -Dinvoker.skip=false -Dinvoker.test=osgi*
233+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=integrity
234+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=j2ee*
235+
./mvnw -Pmain -Dinvoker.skip=false -Dinvoker.test=osgi*
239236
```
240237

241238
Clean Build
@@ -244,7 +241,7 @@ Clean Build
244241
To clean the build it is important to use the same profile for the clean as what you want to build. The best way to clean build something is, i.e. jruby-jars
245242

246243
```
247-
mvn clean install -Pjruby-jars
244+
./mvnw clean install -Pjruby-jars
248245
```
249246

250247
This first cleans everything and then starts the new build in one go!
@@ -253,12 +250,12 @@ Cleaning the build may be necessary after switching to a different
253250
version of JRuby (for example, after switching git branches) to ensure
254251
that everything is rebuilt properly.
255252

256-
NOTE: `mvn clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
253+
NOTE: `./mvnw clean` just cleans the **jruby-core** artifact and the **./lib/jruby.jar**!
257254

258255
Clean everything:
259256

260257
```
261-
mvn -Pclean
258+
./mvnw -Pclean
262259
```
263260

264261
Distribution Packages

maven/jruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mvn verify -Papps
66
```
77
or from the jruby root directory
88
```
9-
mvn -Papps
9+
./mvnw -Papps
1010
```
1111

1212

rakelib/maven.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,6 @@ namespace :maven do
4545

4646
desc "Deploy release and bump version"
4747
task :deploy_release do
48-
system "mvn clean deploy -Psonatype-oss-release,release"
48+
system "./mvnw clean deploy -Psonatype-oss-release,release"
4949
end
5050
end

rakelib/release.rake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ def jruby_version
3636
Dir[File.join(DIST_FILES_DIR, "jruby-dist-*.zip")].each do |f|
3737
return $1 if f =~ /jruby-dist-(.*)-bin.zip/
3838
end
39-
raise ArgumentError "mvn release:prepare has not been run"
39+
raise ArgumentError "./mvnw release:prepare has not been run"
4040
end

test/check_versions.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ gem_version=${jar_version/-/.}
88

99
rm -rf maven/*/target/*
1010

11-
./mvnw install -Pbootstrap
12-
./mvnw -Pcomplete
13-
./mvnw -Pdist
14-
./mvnw -Pjruby-jars
15-
./mvnw -Pmain
11+
./mvnw -ntp install -Pbootstrap
12+
./mvnw -ntp -Pcomplete
13+
./mvnw -ntp -Pdist
14+
./mvnw -ntp -Pjruby-jars
15+
./mvnw -ntp -Pmain
1616

1717
declare -a failed
1818
failed[0]=0

test/jruby/test_jar_complete.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# gets run from 'mvn -P jruby_complete_jar_extended' which ensures that a complete jar is built first
1+
# gets run from './mvnw -Pjruby_complete_jar_extended' which ensures that a complete jar is built first
22

33
require 'test/unit'
44
require 'rbconfig'

tool/maven-ci-script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -x
66
if [[ -v PHASE ]]
77
then
88
DOWNLOAD_OUTPUT_FILTER='Download|\\[exec\\] [[:digit:]]+/[[:digit:]]+|^[[:space:]]*\\[exec\\][[:space:]]*$'
9-
./mvnw $MAVEN_CLI_OPTS -B -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
9+
./mvnw -ntp -Dinvoker.skip=false $PHASE | egrep -v "$DOWNLOAD_OUTPUT_FILTER"
1010

1111
MVN_STATUS=${PIPESTATUS[0]}
1212

0 commit comments

Comments
 (0)