4 Star 16 Fork 5

Kenny小狼 / spring-groovy-samples

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 3.93 KB
一键复制 编辑 原始数据 按行查看 历史
buildscript {
ext {
springBootVersion = '1.2.1.RELEASE'
}
repositories {
maven {
name = 'aliyun-nexus'
url = 'http://maven.aliyun.com/nexus/content/groups/public/'
}
jcenter()
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("io.spring.gradle:dependency-management-plugin:0.6.1.RELEASE")
classpath("org.springframework:springloaded:1.2.6.RELEASE")
}
}
configure(allprojects) { project ->
group = "spring-groovy-example"
version = '1.0'
ext {
junitVersion = "4.12"
gradleScriptDir = "${rootProject.projectDir}/gradle"
}
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
apply plugin: 'groovy'
compileJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
compileTestJava {
sourceCompatibility = 1.7
targetCompatibility = 1.7
}
task createGroovyProject << {
sourceSets*.groovy.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs() }
}
task createSpringBootProject(dependsOn: createGroovyProject) << {
def bootDirs = ['resources/static', 'resources/templates']
bootDirs.each { x ->
file(project.name + '/src/main/' + x).mkdirs()
file(project.name + '/src/test/' + x).mkdirs()
}
}
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
// re-use repositories from buildscript
rootProject.buildscript.repositories.each { repositories.add(it) }
dependencies {
compile("org.codehaus.groovy:groovy")
testCompile("junit:junit:${junitVersion}")
testCompile("org.springframework.boot:spring-boot-starter-test")
}
}
project("spring-boot-samples-simple") {
description = "简单的SpringBoot例子"
}
project("spring-boot-samples-data-jpa") {
description = "SpringBoot+SpringDataJpa+Mysql例子"
dependencies {
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("mysql:mysql-connector-java")
}
}
project('spring-boot-samples-shiro') {
description = "SpringBoot+SpringDataJpa+Mysql+Shiro例子"
ext {
shiroVersion = "1.2.3"
}
dependencies {
compile("org.springframework.boot:spring-boot-starter-thymeleaf")
compile("org.apache.shiro:shiro-core:${shiroVersion}")
compile("org.apache.shiro:shiro-web:${shiroVersion}")
compile("org.apache.shiro:shiro-spring:${shiroVersion}")
}
}
project('spring-boot-samples-jsp') {
description = "SpringBoot使用jsp作为视图。"
//重要!在SpringBoot环境下,要用JSP必须打包成WAR。
apply plugin: 'war'
dependencies {
compile("javax.servlet:jstl")
providedRuntime("org.apache.tomcat.embed:tomcat-embed-jasper")
}
}
project('spring-boot-samples-mail') {
ext {
springBootVersion = '1.2.1.RELEASE'
}
description = "使用SpringBoot进行邮件发送,并且使用velocity作为邮件内容模板。"
dependencies {
compile("org.springframework.boot:spring-boot-starter-mail:${springBootVersion}")
compile("org.springframework.boot:spring-boot-starter-velocity:${springBootVersion}")
}
}
project('spring-boot-samples-schedule') {
description = "使用SpringBoot执行任务调度。"
}
configure(subprojects.findAll { it.name.startsWith('spring-boot') }) {
configurations {
providedRuntime
}
apply plugin: 'spring-boot'
dependencies {
providedRuntime("org.springframework.boot:spring-boot-loader")
compile("com.google.guava:guava:18.0")
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
compile("org.springframework.boot:spring-boot-starter-web")
}
}
Groovy
1
https://gitee.com/kennylee/spring-groovy-samples.git
git@gitee.com:kennylee/spring-groovy-samples.git
kennylee
spring-groovy-samples
spring-groovy-samples
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891