Skip to content

Commit 4ab6c5d

Browse files
committed
feat: add maven wrapper support
Signed-off-by: Chris Laprun <[email protected]>
1 parent 4c5e300 commit 4ab6c5d

File tree

11 files changed

+460
-33
lines changed

11 files changed

+460
-33
lines changed

.github/scripts/installOperatorUsingOlm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ CURRENT_PWD=$(pwd)
1212
kubectl config set-context --current --namespace=$K8S_NAMESPACE
1313

1414
# Build manifests and images
15-
cd $OPERATOR_LOCATION
16-
mvn clean package -Dquarkus.container-image.build=true \
15+
cd $OPERATOR_LOCATION || exit
16+
"$CURRENT_PWD"/mvnw clean package -Dquarkus.container-image.build=true \
1717
-Dquarkus.container-image.push=true \
1818
-Dquarkus.container-image.insecure=true \
1919
-Dquarkus.container-image.registry=$KIND_REGISTRY \
@@ -41,7 +41,7 @@ spec:
4141
EOF
4242

4343
# Wait until the catalog source of our operator is up and running
44-
if ! $CURRENT_PWD/.github/scripts/waitFor.sh pods $K8S_NAMESPACE Running "--selector=olm.catalogSource=$NAME-catalog -o jsonpath='{..status.phase}'"; then
44+
if ! "$CURRENT_PWD"/.github/scripts/waitFor.sh pods $K8S_NAMESPACE Running "--selector=olm.catalogSource=$NAME-catalog -o jsonpath='{..status.phase}'"; then
4545
exit 1;
4646
fi
4747

@@ -60,9 +60,9 @@ spec:
6060
EOF
6161

6262
# Wait until the operator is up and running
63-
if ! $CURRENT_PWD/.github/scripts/waitFor.sh csv $K8S_NAMESPACE Succeeded "$NAME-operator -o jsonpath='{.status.phase}'"; then
63+
if ! "$CURRENT_PWD"/.github/scripts/waitFor.sh csv $K8S_NAMESPACE Succeeded "$NAME-operator -o jsonpath='{.status.phase}'"; then
6464
exit 1;
6565
fi
6666

67-
cd $CURRENT_PWD
67+
cd "$CURRENT_PWD" || exit
6868
exit 0;

.github/workflows/build-for-quarkus-version.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ jobs:
118118
git fetch origin pull/${{ github.event.inputs.josdk-pr }}/head:pr-to-check
119119
git switch pr-to-check
120120
fi
121-
mvn install -DskipTests
122-
echo "josdk_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
123-
echo "josdk_f8_version=$(mvn help:evaluate -Dexpression=fabric8-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
121+
./mvnw install -DskipTests
122+
echo "josdk_version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
123+
echo "josdk_f8_version=$(./mvnw help:evaluate -Dexpression=fabric8-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
124124
cd -
125125
126126
- name: Set JOSDK version from build PR if requested
127127
if: "${{ inputs.josdk-pr != '' }}"
128-
run: mvn versions:set-property -Dproperty='java-operator-sdk.version' -DnewVersion=${{ steps.build-josdk-pr.outputs.josdk_version }}
128+
run: ./mvnw versions:set-property -Dproperty='java-operator-sdk.version' -DnewVersion=${{ steps.build-josdk-pr.outputs.josdk_version }}
129129

130130
- name: Check-out Quarkus if building from PR is requested
131131
uses: actions/checkout@v4
@@ -142,7 +142,7 @@ jobs:
142142
git fetch origin pull/${{ github.event.inputs.quarkus-pr }}/head:pr-to-check
143143
git switch pr-to-check
144144
./update-version.sh 999.${{ github.event.inputs.quarkus-pr }}-SNAPSHOT
145-
echo "quarkus_f8_version=$(mvn help:evaluate -Dexpression=kubernetes-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
145+
echo "quarkus_f8_version=$(./mvnw help:evaluate -Dexpression=kubernetes-client.version -q -DforceStdout)" >> $GITHUB_OUTPUT
146146
./mvnw -Dquickly
147147
cd -
148148
@@ -160,9 +160,9 @@ jobs:
160160
cd fkc
161161
git fetch origin pull/${{ github.event.inputs.fkc-pr }}/head:pr-to-check
162162
git switch pr-to-check
163-
mvn versions:set -DnewVersion=999.${{ github.event.inputs.fkc-pr }}-SNAPSHOT versions:commit
164-
echo "f8_pr_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
165-
mvn clean install -DskipTests
163+
./mvnw versions:set -DnewVersion=999.${{ github.event.inputs.fkc-pr }}-SNAPSHOT versions:commit
164+
echo "f8_pr_version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
165+
./mvnw clean install -DskipTests
166166
cd -
167167
168168
- name: Retrieve Quarkus version from platform
@@ -200,7 +200,7 @@ jobs:
200200
- name: Change Quarkus version
201201
run: |
202202
echo "Using Quarkus ${{ steps.quarkus-version.outputs.quarkus_version }}"
203-
mvn versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=quarkus.version -DnewVersion=${{ steps.quarkus-version.outputs.quarkus_version }}
203+
./mvnw versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=quarkus.version -DnewVersion=${{ steps.quarkus-version.outputs.quarkus_version }}
204204
205205
- name: Change Fabric8 client version
206206
id: fkc-version
@@ -213,25 +213,25 @@ jobs:
213213
fkc_version=${{ steps.build-fkc-pr.outputs.f8_pr_version }}
214214
fi
215215
echo "Using Fabric8 ${fkc_version}"
216-
mvn versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=fabric8-client.version -DnewVersion=${fkc_version}
216+
./mvnw versions:set-property -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dproperty=fabric8-client.version -DnewVersion=${fkc_version}
217217
echo "fkc_version=${fkc_version}" >> $GITHUB_OUTPUT
218218
219219
- name: Output versions being used
220220
run: |
221-
echo "QOSDK version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=project.version -q -DforceStdout)"
222-
echo "JOSDK version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=java-operator-sdk.version -q -DforceStdout)"
221+
echo "QOSDK version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=project.version -q -DforceStdout)"
222+
echo "JOSDK version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=java-operator-sdk.version -q -DforceStdout)"
223223
echo "JOSDK Fabric8 version: ${{ steps.build-josdk-pr.outputs.josdk_f8_version }}"
224224
echo "JOSDK overridden Fabric8 version ${{ steps.fkc-version.outputs.fkc_version }}"
225-
echo "Quarkus version: $(mvn help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=quarkus.version -q -DforceStdout)"
225+
echo "Quarkus version: $(./mvnw help:evaluate -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dexpression=quarkus.version -q -DforceStdout)"
226226
echo "Quarkus Fabric8 version: ${{ steps.build-quarkus-pr.outputs.quarkus_f8_version }}"
227-
echo "Effective Fabric8 version: $(mvn dependency:tree -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dincludes=io.fabric8:kubernetes-client-api -pl core/deployment | grep io.fabric8:kubernetes-client-api -m1 | cut -d ':' -f 4)"
227+
echo "Effective Fabric8 version: $(./mvnw dependency:tree -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -Dincludes=io.fabric8:kubernetes-client-api -pl core/deployment | grep io.fabric8:kubernetes-client-api -m1 | cut -d ':' -f 4)"
228228
229229
- name: Build with Maven (JVM)
230-
run: mvn -B formatter:validate install -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' --file pom.xml
230+
run: ./mvnw -B formatter:validate install -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' --file pom.xml
231231

232232
- name: Dependency tree on failure
233233
if: failure()
234-
run: mvn -B dependency:tree -Dverbose
234+
run: ./mvnw -B dependency:tree -Dverbose
235235

236236
- name: Kubernetes KinD Cluster
237237
uses: container-tools/kind-action@v2
@@ -267,7 +267,7 @@ jobs:
267267
# Run operator in DEV mode
268268
cd samples/joke
269269
# Need to override application.properties setting to avoid using dev services instead of set up cluster
270-
mvn quarkus:dev -Dquarkus.kubernetes-client.devservices.override-kubeconfig=false >app.log 2>&1 &
270+
"$CURRENT_PWD"/mvnw quarkus:dev -Dquarkus.kubernetes-client.devservices.override-kubeconfig=false >app.log 2>&1 &
271271
PID=$(echo $!)
272272
cd $CURRENT_PWD
273273
@@ -296,7 +296,7 @@ jobs:
296296
path: samples/joke/app.log
297297

298298
- name: Build with Maven (Native)
299-
run: mvn -B install -Dnative --file pom.xml -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -pl '${{inputs.native-modules}}' -amd
299+
run: ./mvnw -B install -Dnative --file pom.xml -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' -pl '${{inputs.native-modules}}' -amd
300300

301301
- name: Run Joke sample in native mode
302302
if: ${{ contains(inputs.native-modules, 'samples') }}

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Retrieve Quarkus version
4747
id: quarkus-version
48-
run: echo "quarkus_version=$(mvn help:evaluate -Dexpression=quarkus.version -q -DforceStdout -Puse-snapshots)" >> $GITHUB_OUTPUT
48+
run: echo "quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout -Puse-snapshots)" >> $GITHUB_OUTPUT
4949

5050
- name: Retrieve latest stable Quarkus version from platform
5151
id: get-quarkus-version

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070

7171
- name: Perform quick build
7272
run: |
73-
mvn -Dquickly -Puse-snapshots
73+
./mvnw -Dquickly -Puse-snapshots
7474
7575
- name: Perform CodeQL Analysis
7676
uses: github/codeql-action/analyze@v3

.github/workflows/release-quarkus-platform-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Update QOSDK version to ${{inputs.qosdk-version}} in quarkus-platform ${{inputs.quarkus-platform-branch}}
3333
run: |
34-
mvn -B versions:set-property -Dproperty=quarkus-operator-sdk.version -DnewVersion=${{inputs.qosdk-version}}
34+
./mvnw -B versions:set-property -Dproperty=quarkus-operator-sdk.version -DnewVersion=${{inputs.qosdk-version}}
3535
./mvnw -Dsync
3636
3737
- name: Create quarkus-platform pull request

.github/workflows/release-snapshot.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ jobs:
5252
if: ${{ inputs.version != '' }}
5353
run: |
5454
echo "Set version to ${{inputs.version}}"
55-
mvn versions:set -DnewVersion="${{inputs.version}}" versions:commit -Puse-snapshots
55+
./mvnw versions:set -DnewVersion="${{inputs.version}}" versions:commit -Puse-snapshots
5656
5757
- name: Output information
58-
run: echo "Release snapshot for branch ${{inputs.branch}} with version $(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
58+
run: echo "Release snapshot for branch ${{inputs.branch}} with version $(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)"
5959

6060
- name: Deploy maven snapshot
6161
run: |
62-
mvn -B deploy -DperformRelease -Dno-samples -Dno-docs -Prelease,use-snapshots
62+
./mvnw -B deploy -DperformRelease -Dno-samples -Dno-docs -Prelease,use-snapshots
6363
env:
6464
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
6565
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

.github/workflows/release-update-java-operator-plugins.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
sed -i -e 's|<quarkus-sdk.version>.*</quarkus-sdk.version>|<quarkus-sdk.version>${{inputs.qosdk-version}}</quarkus-sdk.version>|' $(pwd)/testdata/quarkus/memcached-quarkus-operator/pom.xml
2727
2828
echo "Using Quarkus ${{ inputs.quarkus-version }}"
29-
mvn versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}} -f ./testdata/quarkus/memcached-quarkus-operator/pom.xml versions:commit
29+
./mvnw versions:set-property -Dproperty=quarkus.version -DnewVersion=${{inputs.quarkus-version}} -f ./testdata/quarkus/memcached-quarkus-operator/pom.xml versions:commit
3030
sed -i -e 's|<quarkus.version>.*</quarkus.version>|<quarkus.version>${{inputs.quarkus-version}}</quarkus.version>|' $(pwd)/pkg/quarkus/v1beta/scaffolds/internal/templates/pomxml.go
3131
3232
- name: Create java-operator-plugins pull request

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Retrieve Quarkus version
4040
id: quarkus-version
41-
run: echo "quarkus_version=$(mvn help:evaluate -Dexpression=quarkus.version -q -DforceStdout)" >> $GITHUB_OUTPUT
41+
run: echo "quarkus_version=$(./mvnw help:evaluate -Dexpression=quarkus.version -q -DforceStdout)" >> $GITHUB_OUTPUT
4242

4343
- uses: actions/setup-java@v4
4444
with:
@@ -87,10 +87,10 @@ jobs:
8787
fi
8888
8989
git checkout -b release
90-
mvn -B release:prepare -Prelease -Darguments="-DperformRelease -Dno-samples -DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
90+
./mvnw -B release:prepare -Prelease -Darguments="-DperformRelease -Dno-samples -DskipTests" -DreleaseVersion=${{steps.metadata.outputs.current-version}} -DdevelopmentVersion=${{steps.metadata.outputs.next-version}}
9191
git checkout ${{github.base_ref}}
9292
git rebase release
93-
mvn -B release:perform -Darguments="-DperformRelease -Dno-samples -DskipTests" -DperformRelease -Prelease
93+
./mvnw -B release:perform -Darguments="-DperformRelease -Dno-samples -DskipTests" -DperformRelease -Prelease
9494
env:
9595
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
9696
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
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.9.8/apache-maven-3.9.8-bin.zip

0 commit comments

Comments
 (0)