description = '玖道科技可视化平台'
|
buildscript {
|
repositories {
|
maven {
|
url "https://plugins.gradle.org/m2/"
|
}
|
}
|
|
dependencies {
|
// Advanced gradle plugin for running web-apps on jetty and tomcat.
|
classpath 'org.akhikhl.gretty:gretty:1.2.4'
|
// Gradle plugin for running SonarQube analysis.
|
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2"
|
// Combine (w/requireJS), lint, document, minify and gzip your JavaScript.
|
classpath 'com.eriwen:gradle-js-plugin:1.12.1'
|
// Lint, minify and gzip your CSS and LESS.
|
classpath 'com.eriwen:gradle-css-plugin:1.11.1'
|
}
|
}
|
// 构建全局变量
|
ext {
|
VERSION = 1.0
|
JAVA_VERSION = 1.7
|
}
|
// 全局项目设置
|
allprojects {
|
apply plugin: "java"
|
apply plugin: "idea"
|
apply plugin: "eclipse"
|
|
version = VERSION
|
|
sourceCompatibility = JAVA_VERSION
|
targetCompatibility = JAVA_VERSION
|
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
|
repositories {
|
jcenter()
|
mavenCentral()
|
}
|
}
|
// 子项目设置
|
subprojects {
|
// ~~~~~~~ 代码质量检测 ~~~~~~~~~~~~~~
|
// apply plugin: "jacoco"
|
// apply plugin: "checkstyle"
|
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// checkstyle {
|
// configFile = file("../reference/config/checkstyle/sun_check.xml")
|
// sourceSets = [sourceSets.main]
|
// ignoreFailures = true
|
// }
|
|
// 我们使用slf4j&logback,移除commons-logging
|
configurations {
|
all*.exclude group: "org.terracotta"
|
all*.exclude group: "log4j", module: "log4j"
|
all*.exclude group: "org.slf4j", module: "slf4j-log4j12"
|
all*.exclude group: "commons-logging", module: "commons-logging"
|
all*.exclude group: "org.sonatype.sisu.inject", module: "cglib"
|
}
|
|
dependencies {
|
compile fileTree(dir: "../dependency", include: "*.jar")
|
compile "org.slf4j:slf4j-api:$slf4j",
|
"org.slf4j:jul-to-slf4j:$slf4j",
|
"org.slf4j:jcl-over-slf4j:$slf4j",
|
"ch.qos.logback:logback-classic:$logback",
|
"org.logback-extensions:logback-ext-spring:0.1.4",
|
"org.apache.commons:commons-lang3:$commonLang",
|
"org.apache.commons:commons-collections4:4.1",
|
"org.apache.commons:commons-exec:1.3",
|
"commons-io:commons-io:$commonIO",
|
"commons-fileupload:commons-fileupload:$commonFileupload",
|
"com.fasterxml.jackson.core:jackson-core:$jackson2",
|
"com.fasterxml.jackson.core:jackson-databind:$jackson2",
|
"org.apache.httpcomponents:httpclient:$httpclient",
|
"org.apache.httpcomponents:fluent-hc:$httpclient"
|
|
testCompile "junit:junit:$junit",
|
"com.jayway.jsonpath:json-path:$jsonpath",
|
"org.springframework:spring-test:$spring"
|
}
|
|
sourceSets {
|
test {
|
output.resourcesDir = "build/classes/test"
|
copy {
|
from('src/main/resources')
|
into output.resourcesDir
|
includeEmptyDirs = false
|
}
|
}
|
}
|
}
|
|
//apply plugin: "org.sonarqube"
|
//sonarqube {
|
// properties {
|
// property "sonar.host.url", "$sonarHostUrl"
|
// property "sonar.login", "$sonarLogin"
|
// property "sonar.password", "$sonarPassword"
|
// property "sonar.jdbc.url", "$sonarJdbcUrl"
|
// property "sonar.jdbc.driverClassName", "$sonarJdbcDriverClassName"
|
// property "sonar.jdbc.username", "$sonarJdbcUsername"
|
// property "sonar.jdbc.password", "$sonarJdbcPassword"
|
// property "sonar.sourceEncoding", "UTF-8"
|
// property "sonar.jacoco.reportPath", "${project.buildDir}/jacoco/test.exec"
|
// }
|
//}
|
|
// 整个项目的核心配置,基本上包含了所有的依赖,以及spring(包括mvc)和mybatis的配置
|
project(":designer") {
|
apply plugin: "war"
|
apply plugin: "org.akhikhl.gretty"
|
gretty {
|
host = "0.0.0.0"
|
fileLogEnabled = false
|
}
|
product {
|
webapp project
|
}
|
|
dependencies {
|
compile project(":util")
|
compile project(":plugin")
|
compile fileTree(dir: "../dependency", include: "*.jar")
|
compile "javax.inject:javax.inject:$javaxInject",
|
"javax.annotation:javax.annotation-api:$annotationsApi",
|
"cglib:cglib:$cglib",
|
"joda-time:joda-time:$jodaTime",
|
"net.sf.ehcache:ehcache-core:$ehcache",
|
"org.springframework:spring-aop:$spring",
|
"org.springframework:spring-aspects:$spring",
|
"org.springframework:spring-core:$spring",
|
"org.springframework:spring-beans:$spring",
|
"org.springframework:spring-context:$spring",
|
"org.springframework:spring-context-support:$spring",
|
"org.springframework:spring-jdbc:$spring",
|
"org.springframework:spring-tx:$spring",
|
"org.springframework:spring-web:$spring",
|
"org.springframework:spring-webmvc:$spring",
|
"org.freemarker:freemarker:$freemarker",
|
"org.mybatis:mybatis:$mybatis",
|
"org.mybatis:mybatis-spring:$mybatisSpring",
|
"com.h2database:h2:$h2",
|
"mysql:mysql-connector-java:$mysql",
|
"com.alibaba:druid:$druid",
|
"com.github.abel533:ECharts:3.0.0.1",
|
"jstl:jstl:$jstlib",
|
"taglibs:standard:$standard",
|
"org.quartz-scheduler:quartz:2.2.2",
|
"org.apache.shiro:shiro-core:1.2.2",
|
"org.apache.shiro:shiro-web:1.2.2",
|
"org.apache.shiro:shiro-ehcache:1.2.2",
|
"org.apache.shiro:shiro-spring:1.2.2"
|
|
|
providedCompile "javax.servlet:javax.servlet-api:$servlet",
|
"javax.servlet.jsp:javax.servlet.jsp-api:$jsp",
|
"javax.servlet.jsp.jstl:javax.servlet.jsp.jstl-api:$jstl"
|
}
|
|
}
|
|
project(":util") {
|
|
dependencies {
|
compile "mysql:mysql-connector-java:$mysql",
|
"com.h2database:h2:$h2",
|
"org.springframework:spring-web:$spring",
|
"com.belerweb:pinyin4j:$pinyin4j",
|
"commons-codec:commons-codec:$codec",
|
"org.javassist:javassist:$javassist",
|
//前段自动化测试包
|
//"com.moodysalem:phantomjs-wrapper:$phantomjs",
|
//"com.moodysalem:phantomjs-wrapper-windows-binary:$phantomjs",
|
//"com.moodysalem:phantomjs-wrapper-linux-binary:$phantomjs",
|
//"com.moodysalem:phantomjs-wrapper-macosx-binary:$phantomjs",
|
"javax.servlet:javax.servlet-api:$servlet"
|
}
|
|
}
|
|
project(":plugin") {
|
|
dependencies {
|
compile project(":util")
|
compile "org.springframework:spring-web:$spring",
|
"org.springframework:spring-webmvc:$spring",
|
"org.springframework:spring-jdbc:$spring",
|
"org.mybatis:mybatis:$mybatis",
|
"joda-time:joda-time:$jodaTime",
|
"com.alibaba:druid:$druid"
|
}
|
|
}
|