2017-02-15 5 views
0

(1.4.4.RELEASEではなくOK)春ブーツ1.5.1.RELEASEの下では効果がないようだ:excludeDevtools私はデベロッパーツールの依存関係を持つ新鮮な新しい春ブーツ1.5.1.RELEASEプロジェクト作成した

dependencies { 
    compile('org.springframework.boot:spring-boot-starter-thymeleaf') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    compile('org.springframework.boot:spring-boot-devtools') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
} 

Ideaの内部から実行している場合、これは問題ありません。しかし、bootRepackageを実行した後、結果として得られるfat jarにはlibフォルダにdevtools jarがありません。私はbuild.gradleに次のエントリがあります。

bootRepackage {  
    mainClass = 'com.example.HotreloadApplication' 
    excludeDevtools = false 
} 

そして./gradlew bootRepackage及びます。java -jarビルド/ libsに/ hotreload-0.0.1-SNAPSHOT.jarに際には、私はそれがアップ発火ことがわかりますまだdevtoolsなし。瓶を開くと、私はそれが含まれていないことがわかります。

springBootVersionを '1.4.4.RELEASE'に戻すときは、すべてが期待どおりに動作します。

ご協力いただければ幸いです!私はこのメッセージの後に私のbuild.gradleの全体を含めました。

多くのおかげで、 ダンカン

----- build.gradle ----

buildscript { 
    ext { 
     springBootVersion = '1.5.1.RELEASE' 
    } 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'org.springframework.boot' 

jar { 
    baseName = 'hotreload' 
    version = '0.0.1-SNAPSHOT' 
} 

sourceCompatibility = 1.8 

repositories { 
    mavenCentral() 
} 


dependencies { 
    compile('org.springframework.boot:spring-boot-starter-thymeleaf') 
    compile('org.springframework.boot:spring-boot-starter-web') 
    compile('org.springframework.boot:spring-boot-devtools') 
    testCompile('org.springframework.boot:spring-boot-starter-test') 
} 

bootRepackage { 
    mainClass = 'com.example.HotreloadApplication' 
    excludeDevtools = false 
} 

答えて

0

これは間違いなく、Stephaneに感謝します。

springBoot { 
    excludeDevtools = false 
} 

を運が良ければ、このバグは1.5.2で修正される必要があります。回避策はbuild.gradleには、以下のブロックを追加することで、githubのチケットに掲載されています。

ありがとう、 ダンカン

関連する問題