From 8b26d81163fa4cd069425c23957f16a8286ec732 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 20 Jun 2023 17:11:33 +0800 Subject: [PATCH] use mvnw instead of mvn in workflow (#15880) * use mvnw instead of mvn in workflow * fix * more fix --- .circleci/config.yml | 2 +- .github/actions/run-samples/action.yaml | 2 +- .github/workflows/docker.yaml | 2 +- .github/workflows/gradle-plugin-tests.yaml | 2 +- .github/workflows/linux.yaml | 4 ++-- .github/workflows/maven-plugin-tests.yaml | 10 +++++----- .github/workflows/openapi-generator.yaml | 4 ++-- .github/workflows/sonar.yml | 6 +++--- .github/workflows/windows.yaml | 2 +- .travis.yml | 22 +++------------------- CI/circle_parallel.sh | 10 +++++----- 11 files changed, 25 insertions(+), 41 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d7792bf387eb..2649197674a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ commands: # a reusable command with parameters - run: sleep 30 - run: cat /etc/hosts # Test - - run: mvn --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - run: ./mvnw --no-snapshot-updates --quiet clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error - run: name: "Setup custom environment variables" command: echo 'export CIRCLE_NODE_INDEX="<>"' >> $BASH_ENV diff --git a/.github/actions/run-samples/action.yaml b/.github/actions/run-samples/action.yaml index fa0dcd544d05..3bb8c279e1d1 100644 --- a/.github/actions/run-samples/action.yaml +++ b/.github/actions/run-samples/action.yaml @@ -15,5 +15,5 @@ inputs: runs: using: "composite" steps: - - run: mvn clean --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }} + - run: ./mvnw clean --no-snapshot-updates --batch-mode --quiet ${{ inputs.goal }} -P${{ inputs.name }} -Dintegration-test -Dmaven.javadoc.skip=true ${{ inputs.args }} shell: bash diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 1c79c8c2825b..56e102aa33aa 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -26,7 +26,7 @@ jobs: shell: bash run: | sed -i 's/ -it / /g' run-in-docker.sh - ./run-in-docker.sh mvn clean install + ./run-in-docker.sh ./mvnw clean install - name: Build Dockerfile shell: bash diff --git a/.github/workflows/gradle-plugin-tests.yaml b/.github/workflows/gradle-plugin-tests.yaml index d3c9b73894a0..d9c383c44172 100644 --- a/.github/workflows/gradle-plugin-tests.yaml +++ b/.github/workflows/gradle-plugin-tests.yaml @@ -38,7 +38,7 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: | - mvn clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk) # using gradle-6.8.3 via wrapper (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate) (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildDotnetSdk) diff --git a/.github/workflows/linux.yaml b/.github/workflows/linux.yaml index 3d5fa63d4cdd..15c80ef1e4a1 100644 --- a/.github/workflows/linux.yaml +++ b/.github/workflows/linux.yaml @@ -52,7 +52,7 @@ jobs: - name: Build with Maven shell: bash - run: mvn clean -nsu -B --quiet -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress install --file pom.xml + run: ./mvnw clean -nsu -B --quiet -Dorg.slf4j.simpleLogger.defaultLogLevel=error --no-transfer-progress install --file pom.xml env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} @@ -101,7 +101,7 @@ jobs: git config --global core.fileMode false git config --global core.safecrlf false git config --global core.autocrlf true - mvn clean package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true + ./mvnw clean package -Dmaven.test.skip=true -Dmaven.javadoc.skip=true # test with java (jersey2) client generation only as ensure-up-to-date script is run in another job instead ./bin/generate-samples.sh ./bin/configs/java-jersey2-8.yaml # test debugSupportingFiles diff --git a/.github/workflows/maven-plugin-tests.yaml b/.github/workflows/maven-plugin-tests.yaml index c4a5aa677947..d7e61733e0c8 100644 --- a/.github/workflows/maven-plugin-tests.yaml +++ b/.github/workflows/maven-plugin-tests.yaml @@ -37,8 +37,8 @@ jobs: env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} run: | - mvn clean install -DskipTests -Dmaven.javadoc.skip=true - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw clean install -DskipTests -Dmaven.javadoc.skip=true + ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 19fa55468dce..fe213843dc57 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -36,7 +36,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- - name: Run maven - run: mvn clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error + run: ./mvnw clean --no-snapshot-updates --batch-mode --quiet install -DskipTests -Dorg.slf4j.simpleLogger.defaultLogLevel=error env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - run: ls -la modules/openapi-generator-cli/target @@ -74,7 +74,7 @@ jobs: ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- - name: Run unit tests - run: mvn clean --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error + run: ./mvnw clean --no-snapshot-updates --batch-mode --quiet --fail-at-end test -Dorg.slf4j.simpleLogger.defaultLogLevel=error env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Publish unit test reports diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml index 4df69baebf76..ba1e07f603e8 100644 --- a/.github/workflows/sonar.yml +++ b/.github/workflows/sonar.yml @@ -19,8 +19,8 @@ jobs: distribution: 'temurin' java-version: 11 - name: Compile with Maven - run: mvn -B -q clean install jacoco:report + run: ./mvnw -B -q clean install jacoco:report - name: Jacoco Aggregate - run: mvn jacoco:report-aggregate + run: ./mvnw jacoco:report-aggregate - name: Publish to Sonar - run: mvn -B -q -nsu sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} + run: ./mvnw -B -q -nsu sonar:sonar -Dsonar.projectKey=OpenAPITools_openapi-generator -Dsonar.organization=openapitools -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=${{ secrets.SONAR_LOGIN }} -Dsonar.branch.name=${GITHUB_REF##*/} diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 15d3bf87648c..7e36d2732fff 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -44,7 +44,7 @@ jobs: java-version: ${{ matrix.java }} maven-version: 3.8.8 - name: Run maven - run: mvn clean --no-snapshot-updates --batch-mode --quiet install + run: ./mvnw clean --no-snapshot-updates --batch-mode --quiet install env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - name: Setup Gradle diff --git a/.travis.yml b/.travis.yml index 4ae248806772..97a20b0a728a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -127,21 +127,6 @@ before_install: gpg --check-trustdb ; fi; - pushd .; cd website; yarn install; popd - # install Deno - #- sh -s v1.6.2 < ./CI/deno_install.sh - #- export PATH="$HOME/.deno/bin:$PATH" - -install: - # Add Godeps dependencies to GOPATH and PATH - #- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)" - #- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace" - - export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$HOME/.cargo/bin:$PATH:/usr/lib/dart/bin" - #- go version - - gcc -v - - echo $CC - - echo $CXX - #- pub version - #- dart --version script: # fail fast @@ -151,14 +136,13 @@ script: # run integration tests defined in maven pom.xml # WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet. # show "error" only to reduce the log size - - mvn -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error - #- mvn -e --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error + - ./mvnw -e --no-snapshot-updates --quiet --batch-mode --show-version clean install -DskipTests -Dmaven.javadoc.skip=true -Dorg.slf4j.simpleLogger.defaultLogLevel=error 2>&1 | grep -i error after_success: # push to maven repo - if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then if [ "$TRAVIS_BRANCH" = "master" ] && [ -z $TRAVIS_TAG ]; then echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy --quiet -DskipTests=true -B -U -P release --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; + ./mvnw clean deploy --quiet -DskipTests=true -B -U -P release --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; pushd .; cd modules/openapi-generator-gradle-plugin; @@ -167,7 +151,7 @@ after_success: popd; elif [ -z $TRAVIS_TAG ] && [[ "$TRAVIS_BRANCH" =~ ^[0-9]+\.[0-9]+\.x$ ]]; then echo "Publishing from branch $TRAVIS_BRANCH"; - mvn clean deploy --quiet --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; + ./mvnw clean deploy --quiet --settings CI/settings.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error; echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; pushd .; cd modules/openapi-generator-gradle-plugin; diff --git a/CI/circle_parallel.sh b/CI/circle_parallel.sh index dc60d85ae082..4ccb585afed5 100755 --- a/CI/circle_parallel.sh +++ b/CI/circle_parallel.sh @@ -22,7 +22,7 @@ if [ "$NODE_INDEX" = "1" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..." java -version - mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error elif [ "$NODE_INDEX" = "2" ]; then echo "Running node $NODE_INDEX to test Go" @@ -43,7 +43,7 @@ elif [ "$NODE_INDEX" = "2" ]; then go version # run integration tests - mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error elif [ "$NODE_INDEX" = "3" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci.node3' defined in pom.xml ..." @@ -72,7 +72,7 @@ elif [ "$NODE_INDEX" = "3" ]; then echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV - mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node3 -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet verify -Psamples.circleci.node3 -Dorg.slf4j.simpleLogger.defaultLogLevel=error elif [ "$NODE_INDEX" = "4" ]; then echo "Running node $NODE_INDEX to test 'samples.circleci.node4' defined in pom.xml ..." @@ -87,8 +87,8 @@ else echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..." java -version - mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error - mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error + ./mvnw --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error fi