Intellij, Spring dev tools remote, Docker, error Unexpected 404 response uploading class files

后端 未结 3 969
予麋鹿
予麋鹿 2021-01-12 22:09

Im trying to use Spring Boot Dev tools (Spring Remote), and automatically upload recompiled files to my docker container.

I keep receiving Unexpected 404 resp

3条回答
  •  Happy的楠姐
    2021-01-12 22:27

    As of Spring Boot 1.5.0, devtools defaults were changed to exclude the devtools from fat jars.

    If you want to include them, you have to set the excludeDevtools flag to false.

    However, the devtools documentation doesn't explain how to do this. The necessary documentation is actually in the spring-boot-gradle-plugin documentation.

    To do it, you can put this snippet of code in your build.gradle file:

    bootRepackage {
        excludeDevtools = false
    }
    

    Unfortunately, this was buggy at first and had no effect as of Spring Boot 1.5.0. The workaround was to do this instead:

    springBoot {
        excludeDevtools = false
    }
    

    However, I have verified that the bootRepackage approach works for Spring Boot 1.5.8 .

提交回复
热议问题