0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Dockerで環境構築した時に、リアルタイムでコードが反映されない件について

Posted at

Spring bootをDockerで環境構築した時に、リアルタイムでコードが反映されなく困りました。

./mvnw spring-boot:runを実行すると、コメントアウトされているはずの部分のコードが反映され、アプリケーションがエラーで起動しなくなりました。

調べると、MavenGradleなどのビルドツールを使用している場合、古いコンパイル結果が残っている可能性があるとのことでした。

今回の場合は、mavenなので以下のコマンドを実行します。

./mvnw clean

再度、Spring Bootを起動するとエラーがなくなり、無事起動することに成功しました。

これだけでも、問題なさそうに思ったのですが、Dockerイメージを再ビルドしたほうが良いとのことだったので!

docker-compose build --no-cache

最後まで、読んでいただきありがとうございました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?