現在、Spring Bootでlivereloadしたいのですが、うまくいきません。状態としましては、controllerを変更した際には自動的にbuildが走るようになってますのでこちらは問題はないのですが、thymeleafの変更がブラウザに反映されませんので、困っております。恐れ入りますが、打開策をご教授いただけますと幸いです。
OS: macMojave 10.14.6
IDE: IntelliJ IDEA 2019.2.1
Chromeプラグイン: livereload
IDEでやったこと
- Build project automaticallyのチェック
- compiler.automake.allow.when.app.runningのチェック
build.gradle
build.gradle
1plugins { 2 id 'org.springframework.boot' version '2.1.7.RELEASE' 3 id 'io.spring.dependency-management' version '1.0.8.RELEASE' 4 id 'java' 5} 6 7version = '0.0.1-SNAPSHOT' 8sourceCompatibility = '1.8' 9 10configurations { 11 developmentOnly 12 runtimeClasspath { 13 extendsFrom developmentOnly 14 } 15} 16 17repositories { 18 mavenCentral() 19} 20 21bootRun { 22 sourceResources sourceSets.main 23 24} 25 26dependencies { 27 implementation 'org.springframework.boot:spring-boot-starter-data-jpa' 28 implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' 29 implementation 'org.springframework.boot:spring-boot-starter-web' 30 developmentOnly 'org.springframework.boot:spring-boot-devtools' 31 runtimeOnly 'mysql:mysql-connector-java' 32 testImplementation 'org.springframework.boot:spring-boot-starter-test' 33}
application.properties
spring.thymeleaf.check-template-location=true spring.thymeleaf.prefix=classpath:/templates/ spring.thymeleaf.suffix=.html spring.thymeleaf.mode=LEGACYHTML5 spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html spring.thymeleaf.cache=false spring.resources.cache.period = 0 spring.devtools.restart.enabled=true
後は、chromeの検証画面のネットワークでhttp://localhost:35729/livereload.jsのstatusが200でws://localhost:35729/livereloadがstatusで101という状態です。
もうこれ以上やることがありませんので、何か打開策をご教授いただけますと幸いです。また、プラグインのlivereloadを使用しない方法でも解決策がありましたらご教授いただけますと幸いです。
以上、宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。