-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Spring Boot Docker Compose reports exit code 0 on application run failed #40079
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You haven't mentioned it, by I can tell from the log output that, in example 1, you're using I cannot reproduce the behavior you have described in example 2, either with or without |
You're right. Removing Regarding example 2: Issue is resolved. |
I have a simple Spring Boot project and a docker-compose.yaml file, in which among other things a container for a Postgres database is configured. I use Spring Boot Docker Compose to automatically start the database when starting the application.
I noticed that if the Docker command returns an error and the application fails to start, no corresponding exit code (!= 0) is returned to the shell.
Spring Boot version: 3.1.9
Example 1
I start the application with
mvn spring-boot:run
.The error message
Application run failed ... Docker is not running
appears.However, Maven unexpectedly returns a
BUILD SUCCESS
with exit code0
.Log output
Example 2
I test the application with
mvn verify -Dspring.docker.compose.skip.intests.false
.The error message
Application run failed ... Docker is not running
appears several times.However, Maven unexpectedly returns a
BUILD SUCCESS
with exit code0
andTests run: 0, Failures: 0, Errors: 0, Skipped: 0
.The CI/CD pipeline incorrectly reports that all tests have been successful.
However, my expectation is that an exit code != 0 is returned to the shell and the test error is correctly reported in CI/CD.
How to Reproduce
docker-compose.yaml
file with a sample containermvn spring-boot:run
The text was updated successfully, but these errors were encountered: