Run and test a project
Run these commands from the project directory or any directory inside it. spring-cli searches parent directories for spring-cli.json to locate the project root.
Run the application
spring-cli runThe command invokes Maven's spring-boot:run goal. It uses the project's Maven Wrapper when available and falls back to system mvn otherwise. A JDK compatible with the project is required.
If a .env file exists in the project root, spring-cli loads its values for this process. Values from .env override values with the same name in the current shell environment. See Environment variables for the supported file syntax.
Run tests
spring-cli testThis runs Maven's test goal. Pass a Maven Surefire test pattern to run selected tests:
spring-cli test ProductServiceTest
spring-cli test ProductServiceTest,OrderServiceTestTo rerun classes that had failures or errors in existing Surefire reports, use:
spring-cli test --fails-onlyThe failed-class list is read from target/surefire-reports/TEST-*.xml. If no failed tests are found in those reports, the command exits without running Maven. --fails-only takes precedence over a supplied pattern.
Maven resolution
spring-cli first looks for the platform-specific Maven Wrapper in the project root (mvnw or mvnw.cmd). If it cannot find the wrapper, it looks for system Maven on PATH. If neither is available, install Maven or restore the wrapper files.