build.gradle 30.0 KB
Newer Older
1
buildscript {
2
	repositories {
P
Phillip Webb 已提交
3
		maven { url "http://repo.springsource.org/plugins-release" }
4 5
	}
	dependencies {
6
		classpath("org.springframework.build.gradle:propdeps-plugin:0.0.1")
7
		classpath("org.springframework.build.gradle:docbook-reference-plugin:0.2.4")
8
	}
9 10
}

C
Chris Beams 已提交
11
configure(allprojects) {
C
Chris Beams 已提交
12
	ext.aspectjVersion  = "1.7.1"
P
Phillip Webb 已提交
13 14 15 16
	ext.easymockVersion = "2.5.2"
	ext.hsqldbVersion   = "1.8.0.10"
	ext.junitVersion    = "4.11"
	ext.slf4jVersion    = "1.6.1"
17
	ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
18

19
	apply plugin: "propdeps"
P
Phillip Webb 已提交
20
	apply plugin: "java"
21 22
	apply plugin: "propdeps-eclipse"
	apply plugin: "propdeps-idea"
23
	apply from: "${gradleScriptDir}/ide.gradle"
C
Chris Beams 已提交
24

P
Phillip Webb 已提交
25
	group = "org.springframework"
26

27 28
	sourceCompatibility=1.5
	targetCompatibility=1.5
C
Chris Beams 已提交
29

P
Phillip Webb 已提交
30
	[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"]
C
Chris Beams 已提交
31

P
Phillip Webb 已提交
32
	sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
C
Chris Beams 已提交
33

34
	test.systemProperty("java.awt.headless", "true")
C
Chris Beams 已提交
35

36 37 38 39
	repositories {
		maven { url "http://repo.springsource.org/libs-release" }
		maven { url "http://repo.springsource.org/ebr-maven-external" }
	}
C
Chris Beams 已提交
40

41
	dependencies {
42
		testCompile("junit:junit:${junitVersion}")
43 44
		testCompile("org.hamcrest:hamcrest-all:1.3")
		testCompile("org.easymock:easymock:${easymockVersion}")
45
	}
C
Chris Beams 已提交
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67

	ext.javadocLinks = [
		"http://docs.oracle.com/javase/6/docs/api",
		"http://docs.oracle.com/javaee/6/api",
		"http://portals.apache.org/pluto/portlet-2.0-apidocs/",
		"http://commons.apache.org/lang/api-2.5",
		"http://commons.apache.org/codec/apidocs",
		"http://docs.jboss.org/jbossas/javadoc/4.0.5/connector",
		"http://docs.jboss.org/jbossas/javadoc/7.1.2.Final",
		"http://aopalliance.sourceforge.net/doc",
		"http://glassfish.java.net/nonav/docs/v3/api",
		"http://docs.oracle.com/cd/E13222_01/wls/docs90/javadocs", // commonj
		"http://quartz-scheduler.org/api/2.1.5",
		"http://www.eclipse.org/aspectj/doc/released/aspectj5rt-api/",
		"http://hc.apache.org/httpclient-3.x/apidocs",
		"http://fasterxml.github.com/jackson-core/javadoc/2.0.0",
		"http://jackson.codehaus.org/1.4.2/javadoc",
		"http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/apidocs",
		"http://ibatis.apache.org/docs/java/dev",
		"http://tiles.apache.org/framework/apidocs",
		"http://commons.apache.org/dbcp/api-1.2.2",
	] as String[]
68 69
}

70
configure(subprojects) { subproject ->
71
	apply plugin: "merge"
72 73 74
	apply from: "${gradleScriptDir}/publish-maven.gradle"

	jar {
P
Phillip Webb 已提交
75 76 77 78
		manifest.attributes["Created-By"] =
			"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
		manifest.attributes["Implementation-Title"] = subproject.name
		manifest.attributes["Implementation-Version"] = subproject.version
79 80 81 82 83

		from("${rootProject.projectDir}/src/dist") {
			include "license.txt"
			include "notice.txt"
			into "META-INF"
P
Phillip Webb 已提交
84
			expand(copyright: new Date().format("yyyy"), version: project.version)
85 86 87 88
		}
	}

	javadoc {
C
Chris Beams 已提交
89 90
		description = "Generates project-level javadoc for use in -javadoc jar"

91 92 93
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = project.name
C
Chris Beams 已提交
94 95 96 97 98 99
		options.links(project.ext.javadocLinks)

		// suppress warnings due to cross-module @see and @link references;
		// note that global 'api' task does display all warnings.
		logging.captureStandardError LogLevel.INFO
		logging.captureStandardOutput LogLevel.INFO // suppress "## warnings" message
100 101 102
	}

	task sourcesJar(type: Jar, dependsOn:classes) {
P
Phillip Webb 已提交
103
		classifier = "sources"
104
		from sourceSets.main.allJava.srcDirs
P
Phillip Webb 已提交
105
		include "**/*.java", "**/*.aj"
106 107 108
	}

	task javadocJar(type: Jar) {
P
Phillip Webb 已提交
109
		classifier = "javadoc"
110 111 112 113 114 115 116
		from javadoc
	}

	artifacts {
		archives sourcesJar
		archives javadocJar
	}
C
Chris Beams 已提交
117 118 119
}


P
Phillip Webb 已提交
120 121
project("spring-core") {
	description = "Spring Core"
122 123 124 125 126 127 128

	// As of Spring 3.2 spring-core repackages both asm 4.0 and cglib 3.0 and inlines both
	// into the spring-core jar. cglib 3.0 itself depends on asm 4.0, and is therefore
	// further transformed by the JarJar task to depend on org.springframework.asm; this
	// avoids including two different copies of asm unnecessarily. If however future cglib
	// versions drift from the version of asm used by Spring internally, this duplication
	// will become necessary.
P
Phillip Webb 已提交
129 130
	def asmVersion = "4.0"
	def cglibVersion = "3.0"
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

	configurations {
		jarjar
		asm
		cglib
	}

	task asmRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-asm-repack"
		repackJar.version = asmVersion

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
					configurations.asm.each { originalJar ->
						zipfileset(src: originalJar)
					}
P
Phillip Webb 已提交
150
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
				}
			}
		}
	}

	task cglibRepackJar(type: Jar) { repackJar ->
		repackJar.baseName = "spring-cglib-repack"
		repackJar.version = cglibVersion

		doLast() {
			project.ant {
				taskdef name: "jarjar", classname: "com.tonicsystems.jarjar.JarJarTask",
					classpath: configurations.jarjar.asPath
				jarjar(destfile: repackJar.archivePath) {
					configurations.cglib.each { originalJar ->
						zipfileset(src: originalJar)
					}
					// repackage net.sf.cglib => org.springframework.cglib
P
Phillip Webb 已提交
169 170
					rule(pattern: "net.sf.cglib.**", result: "org.springframework.cglib.@1")
					// as mentioned above, transform cglib"s internal asm dependencies from
171 172
					// org.objectweb.asm => org.springframework.asm. Doing this counts on the
					// the fact that Spring and cglib depend on the same version of asm!
P
Phillip Webb 已提交
173
					rule(pattern: "org.objectweb.asm.**", result: "org.springframework.asm.@1")
174 175 176 177 178 179
				}
			}
		}
	}

	dependencies {
180 181 182 183
		asm("org.ow2.asm:asm:${asmVersion}@jar")
		asm("org.ow2.asm:asm-commons:${asmVersion}@jar")
		cglib("cglib:cglib:${cglibVersion}@jar")
		jarjar("com.googlecode.jarjar:jarjar:1.3")
184

185 186
		compile(files(asmRepackJar))
		compile("commons-logging:commons-logging:1.1.1")
187
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
188
		optional("net.sf.jopt-simple:jopt-simple:3.0")
189
		optional("log4j:log4j:1.2.17")
190 191
		testCompile("xmlunit:xmlunit:1.2")
		testCompile("org.codehaus.woodstox:wstx-asl:3.2.7")
192 193 194 195 196 197
	}

	jar {
		// inline all repackaged asm and cglib classes directly into the spring-core jar
		dependsOn asmRepackJar
		from(zipTree(asmRepackJar.archivePath)) {
P
Phillip Webb 已提交
198
			include "org/springframework/asm/**"
199 200 201
		}
		dependsOn cglibRepackJar
		from(zipTree(cglibRepackJar.archivePath)) {
P
Phillip Webb 已提交
202
			include "org/springframework/cglib/**"
203 204
		}
	}
C
Chris Beams 已提交
205 206
}

P
Phillip Webb 已提交
207 208
project("spring-beans") {
	description = "Spring Beans"
209
	dependencies {
210 211
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
212 213 214
		provided("javax.el:el-api:1.0")
		provided("javax.inject:javax.inject:1")
		testCompile("log4j:log4j:1.2.17")
215
	}
C
Chris Beams 已提交
216 217
}

P
Phillip Webb 已提交
218 219
project("spring-aop") {
	description = "Spring AOP"
220
	dependencies {
221 222 223
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
		compile(project(":spring-beans"))
224
		compile("aopalliance:aopalliance:1.0")
225 226 227
		optional("com.jamonapi:jamon:2.4")
		optional("commons-pool:commons-pool:1.5.3")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
228
	}
C
Chris Beams 已提交
229 230
}

P
Phillip Webb 已提交
231 232
project("spring-expression") {
	description = "Spring Expression Language (SpEL)"
233
	dependencies {
234
		compile(project(":spring-core"))
235
	}
C
Chris Beams 已提交
236 237
}

P
Phillip Webb 已提交
238 239
project("spring-instrument") {
	description = "Spring Instrument"
240
	dependencies {
241
		compile(project(":spring-core"))
242 243
	}
	jar {
P
Phillip Webb 已提交
244 245
		manifest.attributes["Premain-Class"] =
			"org.springframework.instrument.InstrumentationSavingAgent"
246
	}
C
Chris Beams 已提交
247 248
}

P
Phillip Webb 已提交
249 250
project("spring-instrument-tomcat") {
	description = "Spring Instrument Tomcat"
251
	dependencies {
252
		provided("org.apache.tomcat:catalina:6.0.16")
253
	}
C
Chris Beams 已提交
254 255
}

P
Phillip Webb 已提交
256 257
project("spring-context") {
	description = "Spring Context"
258
	dependencies {
259
		optional(project(":spring-instrument"))
260 261 262 263 264
		compile(project(":spring-aop"))
		compile(project(":spring-beans"))
		compile(project(":spring-expression"))
		compile(project(":spring-core"))
		compile(files(project(":spring-core").cglibRepackJar))
265 266 267 268 269 270 271 272 273 274 275
		optional("backport-util-concurrent:backport-util-concurrent:3.0")
		optional("javax.ejb:ejb-api:3.0")
		optional("javax.inject:javax.inject:1")
		optional("org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1")
		optional("javax.persistence:persistence-api:1.0")
		optional("javax.validation:validation-api:1.0.0.GA")
		optional("org.beanshell:bsh:2.0b4")
		optional("org.codehaus.groovy:groovy-all:1.8.8")
		optional("org.jruby:jruby:1.6.5.1")
		optional("joda-time:joda-time:2.1")
		optional("org.slf4j:slf4j-api:${slf4jVersion}")
276
		optional("org.hibernate:hibernate-validator:4.3.0.Final")
277 278
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
		optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
279
		testCompile("commons-dbcp:commons-dbcp:1.2.2")
280 281 282 283
		testCompile("javax.inject:com.springsource.org.atinject.tck:1.0.0")
	}

	test {
P
Phillip Webb 已提交
284
		jvmArgs = ["-disableassertions:org.aspectj.weaver.UnresolvedType"] // SPR-7989
285
	}
C
Chris Beams 已提交
286 287
}

P
Phillip Webb 已提交
288 289
project("spring-tx") {
	description = "Spring Transaction"
290
	dependencies {
291 292
		optional(project(":spring-context")) // for JCA, @EnableTransactionManagement
		optional(project(":spring-aop"))
293 294
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
295
		compile("aopalliance:aopalliance:1.0")
296 297 298 299 300 301 302
		provided("com.ibm.websphere:uow:6.0.2.17")
		optional("javax.resource:connector-api:1.5")
		optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
		optional("javax.ejb:ejb-api:3.0")
		testCompile "org.easymock:easymockclassextension:${easymockVersion}"
		testCompile("javax.persistence:persistence-api:1.0")
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
303
	}
C
Chris Beams 已提交
304 305
}

P
Phillip Webb 已提交
306 307 308
project("spring-oxm") {
	description = "Spring Object/XML Marshalling"
	apply from: "oxm.gradle"
309
	dependencies {
310 311
		compile(project(":spring-beans"))
		compile(project(":spring-core"))
312
		optional(project(":spring-context")) // for Jaxb2Marshaller
313
		compile("commons-lang:commons-lang:2.5")
314 315 316 317 318
		optional("com.thoughtworks.xstream:xstream:1.3.1")
		optional("com.sun.xml.bind:jaxb-impl:2.1.7")
		optional("org.jibx:jibx-run:1.2.3")
		optional("org.apache.xmlbeans:xmlbeans:2.4.0")
		optional("org.codehaus.castor:castor-xml:1.3.2")
319 320 321
		testCompile("org.codehaus.jettison:jettison:1.0.1")
		testCompile("xmlunit:xmlunit:1.2")
		testCompile("xmlpull:xmlpull:1.1.3.4a")
322 323 324 325
		testCompile(files(genCastor.classesDir).builtBy(genCastor))
		testCompile(files(genJaxb.classesDir).builtBy(genJaxb))
		testCompile(files(genXmlbeans.classesDir).builtBy(genXmlbeans))
	}
C
Chris Beams 已提交
326 327
}

P
Phillip Webb 已提交
328 329
project("spring-jms") {
	description = "Spring JMS"
330
	dependencies {
331 332 333 334 335
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-aop"))
		compile(project(":spring-context"))
		compile(project(":spring-tx"))
336
		optional(project(":spring-oxm"))
337
		compile("aopalliance:aopalliance:1.0")
338 339 340 341
		optional("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
		provided("org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1")
		optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
		optional("javax.resource:connector-api:1.5")
342
	}
C
Chris Beams 已提交
343 344
}

P
Phillip Webb 已提交
345 346
project("spring-jdbc") {
	description = "Spring JDBC"
347
	dependencies {
348 349
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
350
		optional(project(":spring-context")) // for JndiDataSourceLookup
351
		compile(project(":spring-tx"))
352 353 354 355 356 357
		optional("c3p0:c3p0:0.9.1.2")
		optional("hsqldb:hsqldb:${hsqldbVersion}")
		optional("com.h2database:h2:1.0.71")
		optional("org.apache.derby:derby:10.5.3.0_1")
		optional("org.apache.derby:derbyclient:10.5.3.0_1")
		optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
358
	}
C
Chris Beams 已提交
359 360
}

P
Phillip Webb 已提交
361 362
project("spring-context-support") {
	description = "Spring Context Support"
363
	dependencies {
364 365 366
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
367 368 369 370 371 372 373 374 375 376
		optional(project(":spring-jdbc")) // for Quartz support
		optional(project(":spring-tx")) // for Quartz support
		optional("javax.mail:mail:1.4")
		optional("javax.cache:cache-api:0.5")
		optional("net.sf.ehcache:ehcache-core:2.0.0")
		optional("opensymphony:quartz:1.6.2")
		optional("org.codehaus.fabric3.api:commonj:1.1.0")
		optional("velocity:velocity:1.5")
		optional("org.freemarker:freemarker:2.3.15")
		optional("com.lowagie:itext:2.1.7")
377
		optional("jasperreports:jasperreports:2.0.5")
378 379
		optional("org.slf4j:slf4j-api:${slf4jVersion}")
		provided("javax.activation:activation:1.1")
380
		testCompile("org.apache.poi:poi:3.0.2-FINAL")
381 382
		testCompile("commons-beanutils:commons-beanutils:1.8.0") // for Velocity/JasperReports
		testCompile("commons-digester:commons-digester:1.8.1") // for Velocity/JasperReports
383
		testCompile("hsqldb:hsqldb:${hsqldbVersion}")
384 385 386
	}

	// pick up **/*.types files in src/main
P
Phillip Webb 已提交
387
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
388 389
}

P
Phillip Webb 已提交
390 391
project("spring-web") {
	description = "Spring Web"
392
	dependencies {
393 394 395 396
		compile(project(":spring-core"))
		compile(project(":spring-beans")) // for MultiPartFilter
		compile(project(":spring-aop")) // for JaxWsPortProxyFactoryBean
		compile(project(":spring-context"))
397
		optional(project(":spring-oxm")) // for MarshallingHttpMessageConverter
398
		compile("aopalliance:aopalliance:1.0")
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416
		optional("com.caucho:hessian:3.2.1")
		optional("rome:rome:1.0")
		optional("javax.el:el-api:1.0")
		optional("javax.faces:jsf-api:1.2_08")
		provided("javax.portlet:portlet-api:2.0")
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.servlet.jsp:jsp-api:2.1")
		optional("javax.xml:jaxrpc-api:1.1")
		provided("javax.xml.soap:saaj-api:1.3")
		provided("javax.activation:activation:1.1")
		optional("commons-fileupload:commons-fileupload:1.2")
		optional("commons-io:commons-io:1.3")
		optional("commons-httpclient:commons-httpclient:3.1")
		optional("org.apache.httpcomponents:httpclient:4.2")
		optional("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
		optional("com.fasterxml.jackson.core:jackson-databind:2.0.1")
		optional("taglibs:standard:1.1.2")
		optional("org.eclipse.jetty:jetty-servlet:8.1.5.v20120716") {
P
Phillip Webb 已提交
417
			exclude group: "org.eclipse.jetty.orbit", module: "javax.servlet"
418
		}
419
		optional("org.eclipse.jetty:jetty-server:8.1.5.v20120716") {
P
Phillip Webb 已提交
420
			exclude group: "org.eclipse.jetty.orbit", module: "javax.servlet"
421
		}
422
		optional("log4j:log4j:1.2.17")
423 424
		testCompile(project(":spring-context-support"))  // for JafMediaTypeFactory
		testCompile("xmlunit:xmlunit:1.2")
425 426 427
	}

	// pick up ContextLoader.properties in src/main
P
Phillip Webb 已提交
428
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
429 430
}

P
Phillip Webb 已提交
431 432
project("spring-orm") {
	description = "Spring Object/Relational Mapping"
433 434
	dependencies {
		compile("aopalliance:aopalliance:1.0")
435 436 437 438 439 440 441 442 443 444 445 446
		optional("org.hibernate:hibernate-core:3.3.2.GA")
		optional("org.hibernate:hibernate-annotations:3.4.0.GA")
		optional("org.hibernate:hibernate-entitymanager:3.4.0.GA")
		optional("org.apache.openjpa:openjpa:1.1.0")
		optional("org.eclipse.persistence:org.eclipse.persistence.core:1.0.1")
		optional("org.eclipse.persistence:org.eclipse.persistence.jpa:1.0.1")
		optional("toplink.essentials:toplink-essentials:2.0-41b")
		optional("javax.jdo:jdo-api:3.0")
		optional("org.apache.ibatis:ibatis-sqlmap:2.3.4.726")
		optional("javax.persistence:persistence-api:1.0")
		provided("javax.servlet:servlet-api:2.5")
		testCompile("javax.servlet:javax.servlet-api:3.0.1")
447 448 449 450
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile("commons-dbcp:commons-dbcp:1.2.2")
		testCompile("org.eclipse.persistence:org.eclipse.persistence.asm:1.0.1")
		testCompile("org.eclipse.persistence:org.eclipse.persistence.antlr:1.0.1")
451
		testCompile("hsqldb:hsqldb:${hsqldbVersion}")
452 453 454
		testCompile(project(":spring-web").sourceSets.test.output)
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
455 456
		optional(project(":spring-aop"))
		optional(project(":spring-context"))
457 458
		compile(project(":spring-tx"))
		compile(project(":spring-jdbc"))
459
		optional(project(":spring-web"))
460
	}
C
Chris Beams 已提交
461 462
}

P
Phillip Webb 已提交
463 464
project("spring-orm-hibernate4") {
	description = "Spring Object/Relational Mapping - Hibernate 4 support"
465
	merge.into = project(":spring-orm")
466
	dependencies {
467 468
		compile(project(":spring-tx"))
		compile(project(":spring-jdbc"))
469 470
		optional("org.hibernate:hibernate-core:4.1.0.Final")
		optional("org.hibernate:hibernate-entitymanager:4.1.0.Final")
471
		optional(project(":spring-web"))
472
		optional("javax.servlet:servlet-api:2.5")
473
	}
474 475
}

P
Phillip Webb 已提交
476 477
project("spring-webmvc") {
	description = "Spring Web MVC"
478
	dependencies {
479 480 481 482 483
		compile(project(":spring-core"))
		compile(project(":spring-expression"))
		compile(project(":spring-beans"))
		compile(project(":spring-web"))
		compile(project(":spring-context"))
484 485 486 487 488 489 490 491 492 493 494 495
		optional(project(":spring-context-support")) // for Velocity support
		optional(project(":spring-oxm")) // for MarshallingView
		optional("org.apache.tiles:tiles-api:2.1.2")
		optional("org.apache.tiles:tiles-core:2.1.2")
		optional("org.apache.tiles:tiles-jsp:2.1.2")
		optional("org.apache.tiles:tiles-servlet:2.1.2")
		optional("velocity-tools:velocity-tools-view:1.4")
		optional("net.sourceforge.jexcelapi:jxl:2.6.3")
		optional("org.apache.poi:poi:3.0.2-FINAL")
		optional("com.lowagie:itext:2.1.7")
		optional("jasperreports:jasperreports:2.0.5") {
			exclude group: "xml-apis", module: "xml-apis"
496
		}
497 498 499 500 501 502 503 504
		optional("rome:rome:1.0")
		optional("velocity:velocity:1.5")
		optional("org.freemarker:freemarker:2.3.15")
		optional("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
		optional("com.fasterxml.jackson.core:jackson-databind:2.0.1")
		provided("javax.servlet:jstl:1.2")
		provided("javax.servlet:javax.servlet-api:3.0.1")
		provided("javax.servlet.jsp:jsp-api:2.1")
505 506 507 508
		testCompile(project(":spring-aop"))
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
		testCompile("rhino:js:1.7R1")
		testCompile("xmlunit:xmlunit:1.2")
509
		testCompile("dom4j:dom4j:1.6.1") {
P
Phillip Webb 已提交
510
			exclude group: "xml-apis", module: "xml-apis"
511 512
		}
		testCompile("jaxen:jaxen:1.1.1") {
P
Phillip Webb 已提交
513 514 515
			exclude group: "xml-apis", module: "xml-apis"
			exclude group: "xom", module: "xom"
			exclude group: "xerces", module: "xercesImpl"
516
		}
517 518 519 520 521 522 523 524 525 526 527
		testCompile("org.eclipse.jetty:jetty-servlet:8.1.5.v20120716") {
			exclude group: "org.eclipse.jetty.orbit", module: "javax.servlet"
		}
		testCompile("org.eclipse.jetty:jetty-server:8.1.5.v20120716") {
			exclude group: "org.eclipse.jetty.orbit", module: "javax.servlet"
		}
		testCompile("javax.validation:validation-api:1.0.0.GA")
		testCompile("commons-fileupload:commons-fileupload:1.2")
		testCompile("commons-io:commons-io:1.3")
		testCompile("org.hibernate:hibernate-validator:4.3.0.Final")
		testCompile("org.apache.httpcomponents:httpclient:4.2")
528
		testCompile(project(":spring-web").sourceSets.test.output)
529 530 531
	}

	// pick up DispatcherServlet.properties in src/main
P
Phillip Webb 已提交
532
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
533 534
}

P
Phillip Webb 已提交
535 536
project("spring-webmvc-tiles3") {
	description = "Spring Framework Tiles3 Integration"
537
	merge.into = project(":spring-webmvc")
538
	dependencies {
539
		compile(project(":spring-context"))
540 541 542 543 544 545
		provided("javax.el:el-api:1.0")
		provided("javax.servlet:jstl:1.2")
		provided("javax.servlet.jsp:jsp-api:2.1")
		optional("org.apache.tiles:tiles-request-api:1.0.1")
		optional("org.apache.tiles:tiles-api:3.0.1")
		optional("org.apache.tiles:tiles-core:3.0.1") {
P
Phillip Webb 已提交
546
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
547
		}
548
		optional("org.apache.tiles:tiles-servlet:3.0.1") {
P
Phillip Webb 已提交
549
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
550
		}
551
		optional("org.apache.tiles:tiles-jsp:3.0.1") {
P
Phillip Webb 已提交
552
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
553
		}
554
		optional("org.apache.tiles:tiles-el:3.0.1") {
P
Phillip Webb 已提交
555
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
556
		}
557
		provided("javax.servlet:javax.servlet-api:3.0.1")
558
		compile(project(":spring-web").sourceSets*.output) // mock request & response
559
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
560
	}
561 562
}

P
Phillip Webb 已提交
563 564
project("spring-webmvc-portlet") {
	description = "Spring Web Portlet"
565
	dependencies {
566 567
		provided("javax.servlet:servlet-api:2.5")
		provided("javax.portlet:portlet-api:2.0")
568 569 570 571 572
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
573
		optional("commons-fileupload:commons-fileupload:1.2")
574 575 576
	}

	// pick up DispatcherPortlet.properties in src/main
P
Phillip Webb 已提交
577
	sourceSets.main.resources.srcDirs += "src/main/java"
C
Chris Beams 已提交
578 579
}

P
Phillip Webb 已提交
580 581
project("spring-test") {
	description = "Spring TestContext Framework"
582
	dependencies {
583
		compile(project(":spring-core"))
584 585 586 587 588 589 590 591
		optional(project(":spring-beans"))
		optional(project(":spring-context"))
		optional(project(":spring-jdbc"))
		optional(project(":spring-tx"))
		optional(project(":spring-orm"))
		optional(project(":spring-web"))
		optional(project(":spring-webmvc"))
		optional(project(":spring-webmvc-portlet"), )
592 593
		optional("junit:junit:${junitVersion}")
		optional("org.testng:testng:6.5.2")
594 595 596 597 598 599 600 601 602 603 604
		optional("javax.servlet:servlet-api:2.5")
		optional("javax.servlet.jsp:jsp-api:2.1")
		optional("javax.portlet:portlet-api:2.0")
		optional("javax.persistence:persistence-api:1.0")
		optional("org.aspectj:aspectjweaver:${aspectjVersion}")
		testCompile("org.hibernate:hibernate-core:3.3.2.GA")
		provided("javax.inject:javax.inject:1")
		provided("javax.activation:activation:1.1")
		provided("javax.servlet:jstl:1.2")
		testCompile "org.slf4j:slf4j-jcl:${slf4jVersion}"
		testCompile("hsqldb:hsqldb:${hsqldbVersion}")
605
	}
C
Chris Beams 已提交
606 607
}

P
Phillip Webb 已提交
608 609
project("spring-test-mvc") {
	description = "Spring Test MVC Framework"
610
	merge.into = project(":spring-test")
611
	dependencies {
612
		optional(project(":spring-context"))
613
		compile(project(":spring-webmvc"))
614 615 616 617 618
		provided("javax.servlet:javax.servlet-api:3.0.1")
		optional("org.hamcrest:hamcrest-core:1.3")
		optional("com.jayway.jsonpath:json-path:0.8.1")
		optional("xmlunit:xmlunit:1.2")
		testCompile("org.slf4j:slf4j-jcl:${slf4jVersion}")
619 620 621
		testCompile("javax.servlet:jstl:1.2")
		testCompile("org.hibernate:hibernate-validator:4.3.0.Final")
		testCompile("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
622 623
		testCompile("com.fasterxml.jackson.core:jackson-databind:2.0.1")
		testCompile(project(":spring-context-support"))
624 625 626 627
		testCompile(project(":spring-oxm"))
		testCompile("com.thoughtworks.xstream:xstream:1.3.1")
		testCompile("cglib:cglib-nodep:2.2")
		testCompile("rome:rome:1.0")
628 629
		testCompile("javax.activation:activation:1.1")
		testCompile("javax.mail:mail:1.4")
630 631 632 633
		testCompile("javax.xml.bind:jaxb-api:2.2.6")
		testCompile("org.easymock:easymockclassextension:${easymockVersion}")
		testCompile("org.apache.tiles:tiles-request-api:1.0.1")
		testCompile("org.apache.tiles:tiles-api:3.0.1")
634
		testCompile("org.apache.tiles:tiles-core:3.0.1") {
P
Phillip Webb 已提交
635
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
636 637
		}
		testCompile("org.apache.tiles:tiles-servlet:3.0.1") {
P
Phillip Webb 已提交
638
			exclude group: "org.slf4j", module: "jcl-over-slf4j"
639 640
		}
	}
R
Rob Winch 已提交
641 642
}

P
Phillip Webb 已提交
643 644
project("spring-struts") {
	description = "Spring Struts"
645
	dependencies {
646 647 648 649 650 651 652
		compile(project(":spring-core"))
		compile(project(":spring-beans"))
		compile(project(":spring-context"))
		compile(project(":spring-web"))
		compile(project(":spring-webmvc"))
		compile("struts:struts:1.2.9")
		compile("commons-beanutils:commons-beanutils:1.7.0")
653 654
		provided("javax.servlet:servlet-api:2.5")
		provided("javax.servlet:jstl:1.2")
655
		testCompile(project(":spring-test"))
656
	}
C
Chris Beams 已提交
657 658
}

P
Phillip Webb 已提交
659 660 661
project("spring-aspects") {
	description = "Spring Aspects"
	apply from: "aspects.gradle"
662
	dependencies {
663 664 665 666 667 668
		optional(project(":spring-beans")) // for @Configurable support
		optional(project(":spring-aop")) // for @Async support
		optional(project(":spring-context")) // for @Enable* support
		compile(project(":spring-context-support")) // for JavaMail support
		optional(project(":spring-tx")) // for JPA, @Transactional support
		optional(project(":spring-orm")) // for JPA exception translation support
669
		aspects(project(":spring-orm"))
670 671
		provided("javax.persistence:persistence-api:1.0")
		testCompile("javax.mail:mail:1.4")
672
		ajc("org.aspectj:aspectjtools:${aspectjVersion}")
C
Chris Beams 已提交
673
		rt("org.aspectj:aspectjrt:${aspectjVersion}")
674 675 676 677
		compile("org.aspectj:aspectjweaver:${aspectjVersion}")
		testCompile(project(":spring-core")) // for CodeStyleAspect
		compile(project(":spring-beans")) // for "p" namespace visibility
		testCompile(project(":spring-test"))
678 679
	}
	eclipse.project {
P
Phillip Webb 已提交
680
		natures += "org.eclipse.ajdt.ui.ajnature"
681
		buildCommands = [new org.gradle.plugins.ide.eclipse.model.
P
Phillip Webb 已提交
682
				BuildCommand("org.eclipse.ajdt.core.ajbuilder")]
683
	}
C
Chris Beams 已提交
684 685
}

686
configure(rootProject) {
P
Phillip Webb 已提交
687
	description = "Spring Framework"
688

P
Phillip Webb 已提交
689
	apply plugin: "docbook-reference"
690
	apply plugin: "groovy"
691 692 693
	apply from: "${gradleScriptDir}/jdiff.gradle"

	reference {
P
Phillip Webb 已提交
694 695
		sourceDir = file("src/reference/docbook")
		pdfFilename = "spring-framework-reference.pdf"
696 697
	}

P
Phillip Webb 已提交
698
	// don"t publish the default jar for the root project
699 700 701
	configurations.archives.artifacts.clear()

	dependencies { // for integration tests
702 703 704 705 706 707 708 709 710 711
		testCompile(project(":spring-core"))
		testCompile(project(":spring-beans"))
		testCompile(project(":spring-aop"))
		testCompile(project(":spring-expression"))
		testCompile(project(":spring-context"))
		testCompile(project(":spring-tx"))
		testCompile(project(":spring-jdbc"))
		testCompile(project(":spring-test"))
		testCompile(project(":spring-web"))
		testCompile(project(":spring-webmvc-portlet"))
712
		testCompile(project(":spring-orm"))
713 714
		testCompile("org.hibernate:hibernate-core:4.1.0.Final")
		testCompile("javax.servlet:servlet-api:2.5")
715 716 717 718 719
		testCompile("javax.portlet:portlet-api:2.0")
		testCompile("javax.inject:javax.inject:1")
		testCompile("javax.resource:connector-api:1.5")
		testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
		testCompile("hsqldb:hsqldb:${hsqldbVersion}")
720 721 722
	}

	task api(type: Javadoc) {
P
Phillip Webb 已提交
723 724
		group = "Documentation"
		description = "Generates aggregated Javadoc API documentation."
725
		title = "${rootProject.description} ${version} API"
C
Chris Beams 已提交
726

727 728 729
		options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
		options.author = true
		options.header = rootProject.description
P
Phillip Webb 已提交
730
		options.overview = "src/api/overview.html"
731
		options.splitIndex = true
C
Chris Beams 已提交
732 733
		options.links(project.ext.javadocLinks)

734 735 736
		source subprojects.collect { project ->
			project.sourceSets.main.allJava
		}
C
Chris Beams 已提交
737 738 739 740 741 742 743 744 745 746 747

		classpath = files(
			// ensure servlet 3.x and Hibernate 4.x have precedence on the Javadoc
			// classpath over their respective 2.5 and 3.x variants
			project(":spring-webmvc").sourceSets.main.compileClasspath.files.find { it =~ "servlet-api" },
			rootProject.sourceSets.test.compileClasspath.files.find { it =~ "hibernate-core" },
			// ensure the javadoc process can resolve types compiled from .aj sources
			project(":spring-aspects").sourceSets.main.output
		)
		classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })

P
Phillip Webb 已提交
748
		maxMemory = "1024m"
C
Chris Beams 已提交
749
		destinationDir = new File(buildDir, "api")
750 751 752
	}

	task docsZip(type: Zip) {
P
Phillip Webb 已提交
753 754 755
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "docs"
756 757 758
		description = "Builds -${classifier} archive containing api and reference " +
			"for deployment at http://static.springframework.org/spring-framework/docs."

P
Phillip Webb 已提交
759 760
		from("src/dist") {
			include "changelog.txt"
761 762 763
		}

		from (api) {
764
			into "javadoc-api"
765 766 767
		}

		from (reference) {
768
			into "spring-framework-reference"
769 770 771 772
		}
	}

	task schemaZip(type: Zip) {
P
Phillip Webb 已提交
773 774 775
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "schema"
776 777 778 779 780 781 782
		description = "Builds -${classifier} archive containing all " +
			"XSDs for deployment at http://springframework.org/schema."

		subprojects.each { subproject ->
			def Properties schemas = new Properties();

			subproject.sourceSets.main.resources.find {
P
Phillip Webb 已提交
783
				it.path.endsWith("META-INF/spring.schemas")
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800
			}?.withInputStream { schemas.load(it) }

			for (def key : schemas.keySet()) {
				def shortName = key.replaceAll(/http.*schema.(.*).spring-.*/, '$1')
				assert shortName != key
				File xsdFile = subproject.sourceSets.main.resources.find {
					it.path.endsWith(schemas.get(key))
				}
				assert xsdFile != null
				into (shortName) {
					from xsdFile.path
				}
			}
		}
	}

	task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
P
Phillip Webb 已提交
801 802 803
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist"
804 805 806 807 808
		description = "Builds -${classifier} archive, containing all jars and docs, " +
					"suitable for community download page."

		ext.baseDir = "${baseName}-${project.version}";

P
Phillip Webb 已提交
809 810 811 812
		from("src/dist") {
			include "readme.txt"
			include "license.txt"
			include "notice.txt"
813
			into "${baseDir}"
P
Phillip Webb 已提交
814
			expand(copyright: new Date().format("yyyy"), version: project.version)
815 816 817 818 819 820 821 822 823 824 825 826 827
		}

		from(zipTree(docsZip.archivePath)) {
			into "${baseDir}/docs"
		}

		from(zipTree(schemaZip.archivePath)) {
			into "${baseDir}/schema"
		}

		subprojects.each { subproject ->
			into ("${baseDir}/libs") {
				from subproject.jar
P
Phillip Webb 已提交
828
				if (subproject.tasks.findByPath("sourcesJar")) {
829 830
					from subproject.sourcesJar
				}
P
Phillip Webb 已提交
831
				if (subproject.tasks.findByPath("javadocJar")) {
832 833 834 835 836 837 838 839 840
					from subproject.javadocJar
				}
			}
		}
	}

	// Create an distribution that contains all dependencies (required and optional).
	// Not published by default; only for use when building from source.
	task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
P
Phillip Webb 已提交
841 842 843
		group = "Distribution"
		baseName = "spring-framework"
		classifier = "dist-with-deps"
844 845 846 847 848 849 850 851 852 853
		description = "Builds -${classifier} archive, containing everything " +
			"in the -${distZip.classifier} archive plus all runtime dependencies."

		from zipTree(distZip.archivePath)

		gradle.taskGraph.whenReady { taskGraph ->
			if (taskGraph.hasTask(":${zipTask.name}")) {
				def projectNames = rootProject.subprojects*.name
				def artifacts = new HashSet()
				subprojects.each { subproject ->
854 855
					(subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts +
					subproject.configurations.optional.resolvedConfiguration.resolvedArtifacts).each { artifact ->
856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876
						def dependency = artifact.moduleVersion.id
						if (!projectNames.contains(dependency.name)) {
							artifacts << artifact.file
						}
					}
				}

				zipTask.from(artifacts) {
					into "${distZip.baseDir}/deps"
				}
			}
		}
	}

	artifacts {
		archives docsZip
		archives schemaZip
		archives distZip
	}

	task wrapper(type: Wrapper) {
P
Phillip Webb 已提交
877 878
		description = "Generates gradlew[.bat] scripts"
		gradleVersion = "1.3"
879 880 881 882

		doLast() {
			def gradleOpts = "-XX:MaxPermSize=1024m -Xmx1024m"
			def gradleBatOpts = "$gradleOpts -XX:MaxHeapSize=256m"
P
Phillip Webb 已提交
883
			File wrapperFile = file("gradlew")
884 885
			wrapperFile.text = wrapperFile.text.replace("DEFAULT_JVM_OPTS=",
				"GRADLE_OPTS=\"$gradleOpts \$GRADLE_OPTS\"\nDEFAULT_JVM_OPTS=")
P
Phillip Webb 已提交
886
			File wrapperBatFile = file("gradlew.bat")
887 888 889 890
			wrapperBatFile.text = wrapperBatFile.text.replace("set DEFAULT_JVM_OPTS=",
				"set GRADLE_OPTS=$gradleBatOpts %GRADLE_OPTS%\nset DEFAULT_JVM_OPTS=")
		}
	}
891
}