Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 513e47f

Browse files
wilkinsonamminella
authored andcommitted
Update configuration of Spring IO plugin
This commit updates the configuration of the IO plugin to use an external property, platformVersion, and to only apply the plugin when this property is set. This removes the declaration of a snapshot dependency from the normal build configuration and also breaks a circular dependency between the projects that are in the Platform and the Platform itself. The commit also applies the configuration that was applied to the standard test task, other than code coverage, to the new test tasks that are created by the Spring IO plugin. Two redundant Hibernate mapping files have been deleted. With more recent versions of Hibernate the presence of these files was causing test failures due to duplicate mappings.
1 parent 4fe22fc commit 513e47f

File tree

3 files changed

+25
-45
lines changed

3 files changed

+25
-45
lines changed

build.gradle

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ buildscript {
1010
dependencies {
1111
classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.8'
1212
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
13-
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
13+
classpath 'org.springframework.build.gradle:spring-io-plugin:0.0.3.RELEASE'
1414
}
1515
}
1616

@@ -21,6 +21,8 @@ ext {
2121
linkScmUrl = 'https://github.com/spring-projects/spring-batch'
2222
linkScmConnection = 'git://github.com/spring-projects/spring-batch.git'
2323
linkScmDevConnection = '[email protected]:spring-projects/spring-batch.git'
24+
25+
mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') }
2426
}
2527

2628
allprojects {
@@ -50,7 +52,6 @@ allprojects {
5052
springDataNeo4jVersion = '3.1.0.RC1'
5153
springIntegrationVersion = '4.0.0.RELEASE'
5254
springLdapVersion = '2.0.1.RELEASE'
53-
springIoVersion = '1.0.0.BUILD-SNAPSHOT'
5455

5556
activemqVersion = '5.9.1'
5657
aspectjVersion = '1.8.0'
@@ -131,7 +132,7 @@ subprojects { subproject ->
131132
ext.xLintArg = '-Xlint:all'
132133
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
133134

134-
test {
135+
tasks.withType(Test).all {
135136
// suppress all console output during testing unless running `gradle -i`
136137
logging.captureStandardOutput(LogLevel.INFO)
137138
systemProperty "ENVIRONMENT", environmentProperty
@@ -145,6 +146,13 @@ subprojects { subproject ->
145146
exclude '**/Abstract*.class'
146147
}
147148

149+
test {
150+
jacoco {
151+
append = false
152+
destinationFile = file("$buildDir/jacoco.exec")
153+
}
154+
}
155+
148156
task sourcesJar(type: Jar) {
149157
classifier = 'sources'
150158
from sourceSets.main.allJava
@@ -195,8 +203,21 @@ subprojects { subproject ->
195203
}
196204
}
197205

206+
configure(mainProjects) {
207+
if (project.hasProperty('platformVersion')) {
208+
apply plugin: 'spring-io'
209+
210+
repositories {
211+
maven { url "https://repo.spring.io/libs-snapshot" }
212+
}
213+
214+
dependencies {
215+
springIoVersions "io.spring.platform:platform-versions:${platformVersion}@properties"
216+
}
217+
}
218+
}
219+
198220
project('spring-batch-core') {
199-
apply plugin: 'spring-io'
200221
description = 'Spring Batch Core'
201222

202223
dependencies {
@@ -233,13 +254,10 @@ project('spring-batch-core') {
233254
optional "log4j:log4j:$log4jVersion"
234255

235256
provided "javax.batch:javax.batch-api:$javaxBatchApiVersion"
236-
237-
springIoVersions "io.spring.platform:platform-versions:$springIoVersion@properties"
238257
}
239258
}
240259

241260
project('spring-batch-infrastructure') {
242-
apply plugin: 'spring-io'
243261
description = 'Spring Batch Infrastructure'
244262
dependencies {
245263

@@ -308,8 +326,6 @@ project('spring-batch-infrastructure') {
308326
optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
309327
optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
310328
optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
311-
312-
springIoVersions "io.spring.platform:platform-versions:$springIoVersion@properties"
313329
}
314330
}
315331

@@ -413,7 +429,6 @@ project('spring-batch-infrastructure-tests') {
413429

414430
//Domain for batch job testing
415431
project('spring-batch-test') {
416-
apply plugin: 'spring-io'
417432
description = 'Spring Batch Test'
418433

419434
dependencies {
@@ -432,13 +447,10 @@ project('spring-batch-test') {
432447
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
433448

434449
optional "org.aspectj:aspectjrt:$aspectjVersion"
435-
436-
springIoVersions "io.spring.platform:platform-versions:$springIoVersion@properties"
437450
}
438451
}
439452

440453
project('spring-batch-integration') {
441-
apply plugin: 'spring-io'
442454
description = 'Batch Integration'
443455

444456
dependencies {
@@ -480,8 +492,6 @@ project('spring-batch-integration') {
480492
optional "log4j:log4j:1.2.14"
481493
optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
482494
optional "org.springframework:spring-jms:$springVersion"
483-
484-
springIoVersions "io.spring.platform:platform-versions:$springIoVersion@properties"
485495
}
486496
}
487497

spring-batch-infrastructure-tests/src/test/resources/org/springframework/batch/item/database/Foo-write.hbm.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

spring-batch-infrastructure/src/test/resources/org/springframework/batch/item/database/Foo-write.hbm.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)