Skip to content

Commit 155b88f

Browse files
sbrannencbeams
authored andcommitted
Improve dependency management for spring-test
In Spring 3.1 the spring-test Maven artifact did not have a required dependency on spring-core, but there is practically no part of spring-test that can be used without spring-core. Most test utilities that are intended to be stand-alone utilities in fact use utility classes from spring-core (e.g., ReflectionTestUtils). Even some of the web mocks/stubs use spring-core (e.g., DelegatingServletInputStream). In addition, the current Gradle build configuration for the spring-test module is very simplistic -- in that it does not explicitly list any optional dependencies such as the Servlet and Portlet APIs -- and it defines a 'compile' dependency on spring-webmvc-portlet. The resulting Maven dependencies in the generated POM are therefore not what a typical consumer of the spring-test artifact would reasonably expect. To address these issues, the Gradle build configuration for the spring-test module now explicitly defines the following 'compile' dependencies: - spring-core - spring-webmvc, optional - spring-webmvc-portlet, optional - junit, optional - testng, optional - servlet-api, optional - jsp-api, optional - portlet-api, optional - activation, provided The only required dependency is now spring-core; all other dependencies are 'optional'. Issue: SPR-8861
1 parent 9b10d38 commit 155b88f

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,15 @@ project('spring-webmvc-portlet') {
423423
project('spring-test') {
424424
description = 'Spring TestContext Framework'
425425
dependencies {
426-
compile project(":spring-webmvc-portlet")
427-
compile("javax.activation:activation:1.0", provided)
428-
compile("org.testng:testng:6.5.2", optional)
426+
compile project(":spring-core")
427+
compile(project(":spring-webmvc"), optional)
428+
compile(project(":spring-webmvc-portlet"), optional)
429429
compile("junit:junit:4.10", optional)
430-
compile("javax.servlet:servlet-api:2.5", provided)
430+
compile("org.testng:testng:6.5.2", optional)
431+
compile("javax.servlet:servlet-api:2.5", optional)
432+
compile("javax.servlet.jsp:jsp-api:2.1", optional)
433+
compile("javax.portlet:portlet-api:2.0", optional)
434+
compile("javax.activation:activation:1.0", provided)
431435
testCompile "org.slf4j:slf4j-jcl:1.5.3"
432436
}
433437
}

src/dist/changelog.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ Changes in version 3.2 M1
3232
* support executor qualification with @Async#value (SPR-6847)
3333
* add convenient WebAppInitializer base classes (SPR-9300)
3434
* support initial delay attribute for scheduled tasks (SPR-7022)
35+
* cache by-type lookups in DefaultListableBeanFactory (SPR-6870)
36+
* merge rather than add URI vars to data binding values (SPR-9349)
37+
* support not (!) operator for profile selection (SPR-8728)
38+
* fix regression in ClassPathResource descriptions (SPR-9413)
39+
* improve documentation of @Bean 'lite' mode (SPR-9401)
40+
* improve documentation of annotated class support in the TestContext framework (SPR-9401)
41+
* document support for JSR-250 lifecycle annotations in the TestContext framework (SPR-4868)
42+
* improve dependency management for spring-test (SPR-8861)
43+
3544

3645
Changes in version 3.1.1 (2012-02-16)
3746
-------------------------------------

0 commit comments

Comments
 (0)