-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Closed as not planned
Closed as not planned
Copy link
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
Description
Hello. I have noticed that the way I find the docker-compose.yml file in a multi-module project is different in normal and test situations.
Reproduce
Spring Boot version
- 3.3.4
Build script
dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testAndDevelopmentOnly("org.springframework.boot:spring-boot-docker-compose") // for docker compose
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}application.yml
spring:
docker:
compose:
file: docker/docker-compose.yml
lifecycle-management: start_and_stop
skip:
in-tests: false
Gradle project structure
├── README.md
├── docker
│ └── docker-compose.yml -> docker compose file
├── spring-mvc
│ ├── build.gradle.kts
│ └── src -> SpringBootApplication class
Result
-
I put a breakpoint in the DockerComposeFile.of(File file) method and debugged it
-
file.getAbsolutePath()- non test case:
PROJECT_ABSOLUTE_PATH/docker/docker-compose.yml-> works fine - test case:
PROJECT_ABSOLUTE_PATH/spring-mvc/docker/docker-compose.yml->IllegalArgumentExceptionwithDocker Compose file 'docker/docker-compose.yml' does not exist
- non test case:
Conclusion
When reading the docker compose file location set in application.yml in a multi-module project, the path seems to be different when testing and when not testing.
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue