Skip to content

Commit 96a1597

Browse files
Merge pull request #40 from codehaus-plexus/mvn-setup
Use tah latest Maven version for builds, JDK 17 for deploy
2 parents 076a9bc + dbe9c31 commit 96a1597

File tree

2 files changed

+56
-20
lines changed

2 files changed

+56
-20
lines changed

.github/workflows/maven-deploy.yml

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

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

927
# allow single build
1028
concurrency:
@@ -32,15 +50,18 @@ jobs:
3250
- name: Set up JDK
3351
uses: actions/setup-java@v4
3452
with:
35-
java-version: '11'
36-
distribution: 'temurin'
53+
java-version: ${{ inputs.jdk-version }}
54+
distribution: ${{ inputs.jdk-distribution }}
3755
cache: 'maven'
3856
server-id: plexus-snapshots
3957
server-username: MAVEN_DEPLOY_UID
4058
server-password: MAVEN_DEPLOY_PWD
4159

60+
- name: Set up Maven
61+
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 }}"
62+
4263
- name: Publish Snapshot
43-
run: mvn -e -B -V deploy -DskipTests
64+
run: ./mvnw -e -B -V deploy -DskipTests
4465
env:
4566
MAVEN_DEPLOY_UID: ${{ secrets.MAVEN_DEPLOY_UID }}
4667
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)