Skip to content

Commit b66587e

Browse files
Use tah latest Maven version for builds, JDK 17 for deploy
1 parent 076a9bc commit b66587e

File tree

2 files changed

+55
-20
lines changed

2 files changed

+55
-20
lines changed

.github/workflows/maven-deploy.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@ permissions: {}
55

66
on:
77
workflow_call:
8+
maven-version:
9+
description: 'The Maven version used during build job'
10+
required: false
11+
default: '3.9.6'
12+
type: string
13+
14+
jdk-version:
15+
description: 'jdk version for build'
16+
required: false
17+
default: '17'
18+
type: string
19+
20+
jdk-distribution:
21+
description: 'jdk distribution for build'
22+
required: false
23+
default: 'temurin'
24+
type: string
825

926
# allow single build
1027
concurrency:
@@ -32,15 +49,18 @@ jobs:
3249
- name: Set up JDK
3350
uses: actions/setup-java@v4
3451
with:
35-
java-version: '11'
36-
distribution: 'temurin'
52+
java-version: ${{ inputs.jdk-version }}
53+
distribution: ${{ inputs.jdk-distribution }}
3754
cache: 'maven'
3855
server-id: plexus-snapshots
3956
server-username: MAVEN_DEPLOY_UID
4057
server-password: MAVEN_DEPLOY_PWD
4158

59+
- name: Set up Maven
60+
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"
61+
4262
- name: Publish Snapshot
43-
run: mvn -e -B -V deploy -DskipTests
63+
run: ./mvnw -e -B -V deploy -DskipTests
4464
env:
4565
MAVEN_DEPLOY_UID: ${{ secrets.MAVEN_DEPLOY_UID }}
4666
MAVEN_DEPLOY_PWD: ${{ secrets.MAVEN_DEPLOY_PWD }}

.github/workflows/maven.yml

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,15 @@ on:
2121
workflow_call:
2222
inputs:
2323
maven_args:
24-
description: The arguments to pass to Maven when building the code
24+
description: 'The arguments to pass to Maven when building the code'
2525
required: false
26-
default: --batch-mode --errors --show-version verify javadoc:javadoc
26+
default: '--batch-mode --errors --show-version verify javadoc:javadoc'
27+
type: string
28+
29+
maven-version:
30+
description: 'The Maven version used during build job'
31+
required: false
32+
default: '3.9.6'
2733
type: string
2834

2935
os-matrix:
@@ -51,19 +57,19 @@ on:
5157
type: string
5258

5359
jdk-distribution-matrix:
54-
description: "jdk distribution matrix"
60+
description: 'jdk distribution matrix'
5561
required: false
5662
default: '[ "temurin" ]'
5763
type: string
5864

5965
jdk-fast-fail-build:
60-
description: "jdk fast fail build"
66+
description: 'jdk fast fail build'
6167
required: false
6268
default: '17'
6369
type: string
6470

6571
jdk-distribution-fast-fail-build:
66-
description: "jdk distribution fast fail build"
72+
description: 'jdk distribution fast fail build'
6773
required: false
6874
default: 'temurin'
6975
type: string
@@ -84,8 +90,11 @@ jobs:
8490
distribution: ${{ inputs.jdk-distribution-fast-fail-build }}
8591
cache: 'maven'
8692

93+
- name: Set up Maven
94+
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"
95+
8796
- name: Build with Maven
88-
run: mvn ${{ inputs.maven_args }}
97+
run: ./mvnw ${{ inputs.maven_args }}
8998

9099
build-experimental:
91100
name: Experimental Java 21 build
@@ -96,18 +105,21 @@ jobs:
96105
fail-fast: false
97106
continue-on-error: true
98107
steps:
99-
- name: Checkout
100-
uses: actions/checkout@v4
108+
- name: Checkout
109+
uses: actions/checkout@v4
101110

102-
- name: Set up JDK
103-
uses: actions/setup-java@v4
104-
with:
105-
java-version: '21'
106-
distribution: 'corretto'
107-
cache: 'maven'
111+
- name: Set up JDK
112+
uses: actions/setup-java@v4
113+
with:
114+
java-version: '21'
115+
distribution: 'corretto'
116+
cache: 'maven'
108117

109-
- name: Build with Maven
110-
run: mvn ${{ inputs.maven_args }}
118+
- name: Set up Maven
119+
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"
120+
121+
- name: Build with Maven
122+
run: ./mvnw ${{ inputs.maven_args }}
111123

112124
verify:
113125
needs: build
@@ -134,6 +146,9 @@ jobs:
134146
distribution: ${{ matrix.distribution }}
135147
cache: 'maven'
136148

149+
- name: Set up Maven
150+
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"
151+
137152
- name: Build with Maven
138-
run: mvn ${{ inputs.maven_args }}
153+
run: ./mvnw ${{ inputs.maven_args }}
139154

0 commit comments

Comments
 (0)