ci: always use mvnw instead of mvn
MODIFY
.github/workflows/release.yaml
.github/workflows/release.yaml
@@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'Apiman'
steps:
- - name: Set up `mvnd`
+ - name: Set up `mvn`
run: bash .github/workflows/support/set-mvn-location.sh
- name: Set up Node.js v10
@@ -113,16 +113,16 @@ jobs:
- name: Update Apiman *Parent* Release Version ${{ github.event.inputs.release-version }} in pom.xml
run: |
cd apiman/parent
- mvnd -ntp clean install
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- mvnd -ntp clean install
+ mvn -ntp clean install
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp clean install
- name: Update Apiman Release Version ${{ github.event.inputs.release-version }} in pom.xml
run: |
cd apiman
- mvnd -ntp -N versions:update-parent -DparentVersion="[${{ github.event.inputs.release-version }}]" -DgenerateBackupPoms=false
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- mvnd -ntp clean install
+ mvn -ntp -N versions:update-parent -DparentVersion="[${{ github.event.inputs.release-version }}]" -DgenerateBackupPoms=false
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp clean install
- name: Update Apiman Version in Plugins Project
run: |
@@ -132,9 +132,9 @@ jobs:
- name: Update Apiman Plugins Release Version ${{ github.event.inputs.release-version }} in pom.xml
run: |
cd plugins
- mvnd -ntp -N versions:update-parent -DparentVersion="[${{ github.event.inputs.release-version }}]" -DgenerateBackupPoms=false
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- mvnd -ntp clean install
+ mvn -ntp -N versions:update-parent -DparentVersion="[${{ github.event.inputs.release-version }}]" -DgenerateBackupPoms=false
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.release-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp clean install
- name: Commit changes for Apiman Plugin Registry
env:
@@ -213,37 +213,37 @@ jobs:
- name: Deploy Apiman to Maven Central
run: |
cd apiman
- mvnd deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
+ mvn deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
cd parent
- mvnd deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
+ mvn deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
# Deploy Apiman Plugins to Maven Central
- name: Deploy Apiman Plugins to Maven Central
run: |
cd plugins
- mvnd deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
+ mvn deploy --batch-mode -DskipTests -Prelease --settings /home/runner/.m2/settings.xml
# Update project pom.xml files to next snapshot version and push to GH
- name: Update Apiman Parent Next Snapshot Version ${{ github.event.inputs.snapshot-version }} in pom.xml
run: |
cd apiman/parent
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- name: Update Apiman Next Snapshot Version ${{ github.event.inputs.snapshot-version }} in pom.xml
env:
RELEASE_VERSION: ${{ github.event.inputs.release-version }}
run: |
cd apiman
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- mvnd -ntp versions:update-parent -DparentVersion="[${{ github.event.inputs.snapshot-version }}]" -DgenerateBackupPoms=false -DallowSnapshots=true
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp versions:update-parent -DparentVersion="[${{ github.event.inputs.snapshot-version }}]" -DgenerateBackupPoms=false -DallowSnapshots=true
find . -name "*.properties" -exec sed -i "s|apiman-manager.api-catalog.catalog-url=https://cdn.jsdelivr.net/gh/apiman/apiman-api-catalog@$RELEASE_VERSION/catalog.json|apiman-manager.api-catalog.catalog-url=https://cdn.jsdelivr.net/gh/apiman/apiman-api-catalog@master/catalog.json|" {} \;
find . -name "*.properties" -exec sed -i "s|apiman-manager.plugins.registries=https://cdn.jsdelivr.net/gh/apiman/apiman-plugin-registry@$RELEASE_VERSION/registry.json|apiman-manager.plugins.registries=https://cdn.jsdelivr.net/gh/apiman/apiman-plugin-registry@master/registry.json|" {} \;
- name: Update Apiman Plugins Next Snapshot Version ${{ github.event.inputs.snapshot-version }} in pom.xml
run: |
cd plugins
- mvnd -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
- mvnd -ntp versions:update-parent -DparentVersion="[${{ github.event.inputs.snapshot-version }}]" -DgenerateBackupPoms=false -DallowSnapshots=true
+ mvn -ntp versions:set -DnewVersion="${{ github.event.inputs.snapshot-version }}" -DgenerateBackupPoms=false -DprocessAllModules=true
+ mvn -ntp versions:update-parent -DparentVersion="[${{ github.event.inputs.snapshot-version }}]" -DgenerateBackupPoms=false -DallowSnapshots=true
- name: Commit Changes for Apiman Next Snapshot Version ${{ github.event.inputs.snapshot-version }}
run: |

MODIFY
.github/workflows/support/set-mvn-location.sh
.github/workflows/support/set-mvn-location.sh
#export SDKMAN_DIR="$HOME/.sdkman"; [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" >> ~/.bashrc
#export SDKMAN_DIR="$HOME/.sdkman"; [[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" >> ~/.bash_profile
-echo 'mvn-or-mvnw() {
+local mvnFunc='mvn-or-mvnw() {
local dir="$PWD"
while [[ ! -x "$dir/mvnw" && "$dir" != / ]]; do
dir="${dir:h}"
@@ -21,6 +21,9 @@ echo 'mvn-or-mvnw() {
fi
command mvn "$@"
-}' >> ~/.bash_profile
+}'
-alias mvnw="mvn-or-mvnw" >> ~/.bash_profile
+echo $mvnFunc >> ~/.bash_profile
+echo $mvnFunc >> ~/.bashrc
+alias mvn="mvn-or-mvnw" >> ~/.bash_profile
+alias mvn="mvn-or-mvnw" >> ~/.bash_profile
\ No newline at end of file

MODIFY
.github/workflows/verify.yaml
.github/workflows/verify.yaml
@@ -53,7 +53,7 @@ jobs:
submodules: true
fetch-depth: 0
- - name: Set up `mvnd`
+ - name: Set up `mvn`
run: bash .github/workflows/support/set-mvn-location.sh
- name: Set up JDK ${{ matrix.java }}
@@ -65,7 +65,7 @@ jobs:
- name: Get Apiman version
id: apiman-version-data
- # Don't use mvnd for `help:evaluate` command, output is messed up.
+ # Don't use mvn for `help:evaluate` command, output is messed up.
run: |
export APIMAN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "::set-output name=apiman-version::$APIMAN_VERSION"
@@ -93,7 +93,8 @@ jobs:
run: ./fastbuild.sh
- name: Run platform-specific integration tests (${{ matrix.integration-suite.name }})
- run: mvnd test install -Dmaven.javadoc.skip=true ${{ matrix.integration-suite.command }}
+
+ run: mvn test install -Dmaven.javadoc.skip=true ${{ matrix.integration-suite.command }}
- name: Test Summary
uses: test-summary/action@v1
@@ -111,7 +112,7 @@ jobs:
submodules: true
fetch-depth: 0
- - name: Set up `mvnd`
+ - name: Set up `mvn`
run: bash .github/workflows/support/set-mvn-location.sh
- name: Set up JDK 11 (for deploying assets, docker builds, etc)
@@ -152,7 +153,7 @@ jobs:
submodules: true
fetch-depth: 0
- - name: Set up `mvnd`
+ - name: Set up `mvn`
run: bash .github/workflows/support/set-mvn-location.sh
- name: Tag/retag snapshot
@@ -182,15 +183,15 @@ jobs:
- name: 'Apiman Parent: Build and deploy POM/BOM & deploy to OSSRH Snapshots'
run: |
cd parent
- mvnd -B clean install
- mvnd -B deploy
+ mvn -B clean install
+ mvn -B deploy
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
- name: 'Apiman: Build and deploy main project to OSSRH Snapshots'
run: |
- mvnd -B deploy -DskipTests -Dmaven.test.skip=true
+ mvn -B deploy -DskipTests -Dmaven.test.skip=true
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}

ci: always use mvnw instead of mvn