2015-01-13 12 views
5

Spring Boot and Gradleを使用している場合、依存関係のクロージャに「tag :: jetty []」や「end :: jetty []」のようなコメントがいくつかあります。それらの構文を考えると、私は彼らがspring boot gradle pluginのようなものによって解析されると仮定します。これらは何をするのですか?彼らはスプリングブートアクチュエータと埋め込み桟橋を動作させる必要がありますか?スプリングブートグラデルファイルの "tag :: ..."構文は何ですか?

以下docsからのサンプル(依存関係の閉鎖を参照してください):

buildscript { 
    repositories { 
     mavenCentral() 
    } 
    dependencies { 
     classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.10.RELEASE") 
    } 
} 

apply plugin: 'java' 
apply plugin: 'eclipse' 
apply plugin: 'idea' 
apply plugin: 'spring-boot' 

jar { 
    baseName = 'gs-spring-boot' 
    version = '0.1.0' 
} 

repositories { 
    mavenCentral() 
} 

dependencies { 
    // tag::jetty[] 
    compile("org.springframework.boot:spring-boot-starter-web") { 
     exclude module: "spring-boot-starter-tomcat" 
    } 
    compile("org.springframework.boot:spring-boot-starter-jetty") 
    // end::jetty[] 
    // tag::actuator[] 
    compile("org.springframework.boot:spring-boot-starter-actuator") 
    // end::actuator[] 
    testCompile("junit:junit") 
} 

task wrapper(type: Wrapper) { 
    gradleVersion = '1.11' 
} 

答えて

9

Gradle Getting Started guide on spring.ioの下部に述べたように:

:埋め込まれた多くの開始/終了のコメントがありますここに。これにより、上記の詳細な説明のために、このガイドにビルドファイルのビットを抽出することができます。実動ビルド・ファイルではそれらは必要ありません。

いいえ、タグは不要です。コードが変更されたときに自動的にガイドのビットを更新するためのものです。

関連する問題