🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 13.3. Gradle ### 13.3. Gradle Gradle用户可以直接在它们的`dependencies`节点处导入”starters“。跟Maven不同的是,这里不用导入"super parent",也就不能共享配置。 ``` apply plugin: 'java' repositories { maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } } dependencies { compile("org.springframework.boot:spring-boot-starter-web:1.4.1.BUILD-SNAPSHOT") } ``` 跟maven类似,spring boot也有gradle插件[spring-boot-gradle-plugin](../VIII.%20Build%20tool%20plugins/65.%20Spring%20Boot%20Gradle%20plugin.md),它能够提供任务用于创建可执行jar,或从源码(source)运行项目。它也提供[依赖管理](http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#build-tool-plugins-gradle-dependency-management)的能力,该功能允许你省略Spring Boot管理的任何依赖的version版本号: ``` buildscript { repositories { maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.1.BUILD-SNAPSHOT") } } apply plugin: 'java' apply plugin: 'spring-boot' repositories { maven { url "http://repo.spring.io/snapshot" } maven { url "http://repo.spring.io/milestone" } } dependencies { compile("org.springframework.boot:spring-boot-starter-web") testCompile("org.springframework.boot:spring-boot-starter-test") } ```