2017-12-06 19 views
0

Spring Boot、Kotlin、Intellijを使用してかなり単純な静的コンテンツWebサーバーを構築しました。私は自分のプログラムを実行し、それはlocalhost:8080で自分のhtmlを正しく扱います。しかし、サーバが動作している間にそのhtmlを更新すると、ブラウザのページを強制的にリロードしても、私の変更は表示されません。私は問題の可能性があるものをたくさん読んだ。 thymeleafキャッシュに関する何か。スプリングブートDevtools。 Intellijの自動ビルドなど。何も動作していないようです。多分私のコード上の目の余分なセットは、私が行方不明のものを拾う可能性があります。Springブートで静的なhtmlを更新しない(Kotlin/Intellijで)

ここに私のbuild.gradleが

buildscript { 
    ext.kotlin_version = "1.2.0" 
    ext.httpcomponents_version = "4.5.4" 
    ext.springframework_version = "1.5.9.RELEASE" 

    repositories { 
     mavenCentral() 
    } 

    dependencies { 
     classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 
     classpath "org.springframework.boot:spring-boot-gradle-plugin:$springframework_version" 
    } 
} 

group "com.atomicslurry" 
version "1.0" 

apply plugin: "java" 
apply plugin: "kotlin" 
apply plugin: "spring-boot" 

sourceCompatibility = 1.8 

repositories { 
    mavenCentral() 
} 

dependencies { 
    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" 
    compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" 
    compile "org.apache.httpcomponents:httpclient:$httpcomponents_version" 
    compile "org.apache.httpcomponents:fluent-hc:$httpcomponents_version" 
    compile "com.fasterxml.jackson.module:jackson-module-kotlin:2.9.2" 
    compile "org.springframework.boot:spring-boot-starter-thymeleaf:$springframework_version" 
    compile "org.springframework.boot:spring-boot-devtools:$springframework_version" 
    testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" 
} 

compileKotlin { 
    kotlinOptions.jvmTarget = "1.8" 
} 

compileTestKotlin { 
    kotlinOptions.jvmTarget = "1.8" 
} 

だ。ここに私kotlinアプリメイン

package com.atomicslurry.sentinel 

import org.springframework.boot.SpringApplication 
import org.springframework.boot.autoconfigure.SpringBootApplication 

@SpringBootApplication 
open class App 

fun main(args: Array<String>) { 
    SpringApplication.run(App::class.java, *args) 
} 

は最後に、私の静的なHTMLは、SRC /メイン/リソース/静的

に任意のアイデアですね。

+0

私はkotlinを使用していません。私のSpringBootApplicationは少し違って見えますが、私にとってはうまくいきます... – mrkernelpanic

答えて

0

私のために働いている一般的なワークフロー:

  1. 編集HTML
  2. 押してブラウザへの移動
  3. を完了し、変更するまで待つと
  4. を更新し、IntelliJのでプロジェクト(CTR + F9)を構築します
関連する問題