目標

Spring Boot 外掛程式具有以下目標

目標 描述

spring-boot:build-image

使用 buildpack 將應用程式打包成 OCI 映像,並分叉生命週期以確保 package 已執行。此目標適用於命令列調用。如果您需要在建置中配置目標 execution,請改用 build-image-no-fork

spring-boot:build-image-no-fork

使用 buildpack 將應用程式打包成 OCI 映像,但不分叉生命週期。當您在建置中配置目標 execution 時,應使用此目標。若要在命令列上調用目標,請改用 build-image

spring-boot:build-info

根據目前 MavenProject 的內容產生 build-info.properties 檔案。

spring-boot:help

顯示 spring-boot-maven-plugin 的幫助資訊。呼叫 mvn spring-boot:help -Ddetail=true -Dgoal=<goal-name> 以顯示參數詳細資訊。

spring-boot:process-aot

在應用程式上調用 AOT 引擎。

spring-boot:process-test-aot

在測試上調用 AOT 引擎。

spring-boot:repackage

重新打包現有的 JAR 和 WAR 歸檔,以便可以使用 java -jar 從命令列執行。使用 layout=NONE 也可以僅用於打包具有巢狀依賴項的 JAR(且沒有主類別,因此不可執行)。

spring-boot:run

就地執行應用程式。

spring-boot:start

啟動 Spring 應用程式。與 run 目標相反,此目標不會阻塞,並允許其他目標對應用程式進行操作。此目標通常用於整合測試情境中,在測試套件之前啟動應用程式,並在之後停止。

spring-boot:stop

停止已由 "start" 目標啟動的應用程式。通常在測試套件完成後調用。

spring-boot:test-run

使用測試執行階段類別路徑就地執行應用程式。將用於啟動應用程式的主類別確定如下:已配置的主類別(如果有的話)。然後是在測試類別目錄中找到的主類別(如果有的話)。然後是在類別目錄中找到的主類別(如果有的話)。