嗨開發人員朋友我需要幫助當我嘗試從 github 部署到我的 Azure AppService 時,github 控制臺向我顯示以下錯誤。
嗨開發人員朋友我需要幫助當我嘗試從 github 部署到我的 Azure AppService 時,github 控制臺向我顯示以下錯誤。
無法在專案 FastFoodApp 上執行目標 org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test):有測驗失敗。
請參閱 /home/runner/work/Project-Name/target/surefire-reports 了解各個測驗結果。請參考轉儲檔案(如果存在)[日期].dump、[日期]-jvmRun[N].dump 和[日期].dumpstream。-> [幫助 1]
要查看錯誤的完整堆疊跟蹤,請使用 -e 開關重新運行 Maven。使用 -X 開關重新運行 Maven 以啟用完整的除錯日志記錄。
我已經嘗試在 .yml 檔案中添加 mvn clean install -DskipTests 。還添加在 pom.xml 檔案中
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
</dependency>
還
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<testFailureIgnore>true</testFailureIgnore>
</configuration>
</plugin>
我還嘗試注釋掉 src/test/java -> test.java 中的所有代碼
但最后它總是向我顯示同樣的錯誤
這是 .yml 檔案
name: Build and deploy JAR app to Azure Web App - fastfoodapi
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build with Maven
run: mvn clean install
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v2
with:
name: java-app
path: '${{ github.workspace }}/target/*.jar'
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: 'Production'
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }}
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v2
with:
name: java-app
- name: Deploy to Azure Web App
id: deploy-to-webapp
uses: azure/webapps-deploy@v2
with:
app-name: 'fastfoodapi'
slot-name: 'Production'
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_2896B985447E4F1D85D4FE3ECA3795AC }}
package: '*.jar'
uj5u.com熱心網友回復:
請嘗試以下步驟來解決錯誤:
- 右鍵單擊專案>作為 Maven 測驗運行。
- 丟失的插件將自動下載。
- 右鍵單擊專案>更新Maven專案,之后錯誤應該消失了。
參考:
- 未能執行目標 org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test" 和 "test(s) <[]> cannot be found"
- 如何在maven中解決“未能執行目標”maven-surefire-plugin:2.19.1“
- 未能執行目標 org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test
- 未能執行目標 org.apache.maven.plugins:maven-surefire-plugin:2.10:test
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/481860.html
下一篇:樣式化組件無法設定:懸停屬性
