From a30d074716faecc70290c23265d5a141591b783f Mon Sep 17 00:00:00 2001 From: Li Yanhui Date: Mon, 8 Apr 2013 15:54:17 +0800 Subject: [PATCH] group dependencies --- build.gradle | 113 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 40 deletions(-) diff --git a/build.gradle b/build.gradle index c054d1e1f..29f079086 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,6 @@ ext { java_version = '1.6' project_build_sourceEncoding = 'UTF-8' project_reporting_outputEncoding = 'UTF-8' - spring_framework_version = '3.2.2.RELEASE' spring_data_jpa_version = '1.3.0.RELEASE' jsp_version = '2.2' jstl_version = '1.2' @@ -55,49 +54,84 @@ buildscript { apply plugin: 'tomcat' +configurations.all { + resolutionStrategy { + eachDependency { details -> + if (!details.requested.version) { + if (details.requested.group == 'org.springframework') { + details.useVersion '3.2.2.RELEASE' + } + else if (details.requested.group == 'org.hibernate') { + details.useVersion '4.1.9.Final' + } + } + } + } +} + +configurations { + web + database + tools + date + spring + hibernate + log + + compile.extendsFrom spring, web, date, tools, hibernate + runtime.extendsFrom database, log +} + dependencies { - compile("org.jadira.usertype:usertype.core:${jadira_usertype_core_version}") - compile("javax.validation:validation-api:${validation_version}") - compile("javax.servlet:jstl:${jstl_version}") - compile("org.springframework.data:spring-data-jpa:${spring_data_jpa_version}") { + spring("org.springframework.data:spring-data-jpa:${spring_data_jpa_version}") { exclude group: 'org.springframework', module: '*' } - compile("org.springframework:spring-jdbc:${spring_framework_version}") - compile("org.springframework:spring-aop:${spring_framework_version}") - compile("org.springframework:spring-webmvc:${spring_framework_version}") - compile("org.springframework:spring-tx:${spring_framework_version}") - compile("org.springframework:spring-context-support:${spring_framework_version}") { + + spring("org.springframework:spring-jdbc") + spring("org.springframework:spring-aop") + spring("org.springframework:spring-webmvc") + spring("org.springframework:spring-tx") + spring("org.springframework:spring-context-support") { exclude group: 'quartz', module: 'quartz' } - compile("org.springframework:spring-orm:${spring_framework_version}") - compile("org.springframework:spring-oxm:${spring_framework_version}") { + spring("org.springframework:spring-orm") + spring("org.springframework:spring-oxm") { exclude group: 'commons-lang', module: 'commons-lang' } - compile("org.springframework:spring-jms:${spring_framework_version}") - compile("rome:rome:${rome_version}") - compile("joda-time:joda-time:${jodatime_version}") - compile("joda-time:joda-time-hibernate:${jodatime_hibernate_version}") - compile("joda-time:joda-time-jsptags:${jodatime_jsptags_version}") - runtime("org.hsqldb:hsqldb:${hsqldb_version}") - compile("javax.servlet.jsp.jstl:jstl-api:${jstl_version}") - compile("org.glassfish.web:jstl-impl:${jstl_version}") - compile("org.hibernate:hibernate-core:${hibernate_version}") { + spring("org.springframework:spring-jms") + + hibernate("org.hibernate:hibernate-core") { exclude group: 'asm', module: 'asm-attrs' } - compile("org.hibernate:hibernate-entitymanager:${hibernate_version}") - compile("org.hibernate.javax.persistence:hibernate-jpa-2.0-api:${hibernate_jpa_version}") - compile("org.hibernate:hibernate-validator:${hibernate_validator_version}") - compile("org.hibernate:hibernate-ehcache:${hibernate_version}") - compile("net.sf.ehcache:ehcache-core:${ehcache_version}") { + hibernate("org.hibernate:hibernate-entitymanager") + hibernate("org.hibernate.javax.persistence:hibernate-jpa-2.0-api:${hibernate_jpa_version}") + hibernate("org.hibernate:hibernate-validator:${hibernate_validator_version}") + hibernate("org.hibernate:hibernate-ehcache") + + web("javax.validation:validation-api:${validation_version}") + web("javax.servlet:jstl:${jstl_version}") + web("javax.servlet.jsp.jstl:jstl-api:${jstl_version}") + web("org.glassfish.web:jstl-impl:${jstl_version}") + web("com.github.dandelion:datatables-jsp:${dandelion_datatables_version}") + web("com.github.dandelion:datatables-export-itext:${dandelion_datatables_version}") + web("com.github.dandelion:datatables-servlet2:${dandelion_datatables_version}") + + tools("rome:rome:${rome_version}") + tools("net.sf.ehcache:ehcache-core:${ehcache_version}") { exclude group: 'commons-logging', module: 'commons-logging' } - compile("org.webjars:bootstrap:${webjars_bootstrap_version}") - compile("org.webjars:jquery-ui:${webjars_jquery_ui_version}") - compile("org.webjars:jquery:${webjars_jquery_version}") - compile("org.aspectj:aspectjrt:${aspectj_version}") - compile("com.github.dandelion:datatables-jsp:${dandelion_datatables_version}") - compile("com.github.dandelion:datatables-export-itext:${dandelion_datatables_version}") - compile("com.github.dandelion:datatables-servlet2:${dandelion_datatables_version}") + tools("org.webjars:bootstrap:${webjars_bootstrap_version}") + tools("org.webjars:jquery-ui:${webjars_jquery_ui_version}") + tools("org.webjars:jquery:${webjars_jquery_version}") + tools("org.aspectj:aspectjrt:${aspectj_version}") + + date("org.jadira.usertype:usertype.core:${jadira_usertype_core_version}") + date("joda-time:joda-time:${jodatime_version}") + date("joda-time:joda-time-hibernate:${jodatime_hibernate_version}") + date("joda-time:joda-time-jsptags:${jodatime_jsptags_version}") + + database("org.hsqldb:hsqldb:${hsqldb_version}") + database("commons-dbcp:commons-dbcp:${commons_dbcp_version}") providedCompile("javax.el:el-api:${javax_el_version}") providedCompile("javax.servlet:servlet-api:${servlet_version}") @@ -105,15 +139,14 @@ dependencies { providedCompile("javax.xml.bind:jaxb-api:${jaxb_api_version}") providedCompile("com.sun.xml.bind:jaxb-impl:${jaxb_impl_version}") - runtime("commons-dbcp:commons-dbcp:${commons_dbcp_version}") - runtime("org.slf4j:jcl-over-slf4j:${slf4j_version}") - runtime("org.slf4j:slf4j-api:${slf4j_version}") - runtime("org.slf4j:jul-to-slf4j:${slf4j_version}") - runtime("ch.qos.logback:logback-classic:${logback_version}") - runtime("ch.qos.logback:logback-core:${logback_version}") + log("org.slf4j:jcl-over-slf4j:${slf4j_version}") + log("org.slf4j:slf4j-api:${slf4j_version}") + log("org.slf4j:jul-to-slf4j:${slf4j_version}") + log("ch.qos.logback:logback-classic:${logback_version}") + log("ch.qos.logback:logback-core:${logback_version}") runtime("org.aspectj:aspectjweaver:${aspectj_version}") - testCompile("org.springframework:spring-test:${spring_framework_version}") + testCompile("org.springframework:spring-test") testCompile("junit:junit:${junit_version}") testCompile("org.hamcrest:hamcrest-library:${hamcrest_version}") testCompile("org.hamcrest:hamcrest-core:${hamcrest_version}")