1 Star 0 Fork 0

Vincent/spring-batch

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 31.75 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
//description = 'Spring Batch'
//apply plugin: 'base'
buildscript {
repositories {
maven { url 'https://repo.spring.io/plugins-release' }
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
classpath 'io.spring.gradle:spring-io-plugin:0.0.5.RELEASE'
classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2"
classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.6"
classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16"
}
}
plugins {
id 'org.sonarqube' version '2.6.2'
}
ext {
linkHomepage = 'https://projects.spring.io/spring-batch/'
linkCi = 'https://build.spring.io/browse/BATCH'
linkIssue = 'https://jira.spring.io/browse/BATCH'
linkScmUrl = 'https://github.com/spring-projects/spring-batch'
linkScmConnection = 'git://github.com/spring-projects/spring-batch.git'
linkScmDevConnection = '[email protected]:spring-projects/spring-batch.git'
mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') && it.name.startsWith('spring-batch-')}
}
allprojects {
group = 'org.springframework.batch'
repositories {
maven { url 'https://repo.spring.io/libs-snapshot' }
maven { url 'https://repo.spring.io/libs-milestone' }
maven { url 'https://repo.spring.io/plugins-release' }
mavenCentral()
}
ext {
environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
springVersionDefault = '5.2.0.M1'
springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
springRetryVersion = '1.2.4.RELEASE'
springAmqpVersion = '2.2.0.M1'
springDataCommonsVersion = '2.2.0.M3'
springDataGemfireVersion = '2.2.0.M3'
springDataJpaVersion = '2.2.0.M3'
springDataMongodbVersion = '2.2.0.M3'
springDataNeo4jVersion = '5.2.0.M3'
springIntegrationVersion = '5.2.0.M1'
springLdapVersion = '2.3.2.RELEASE'
activemqVersion = '5.15.9'
aspectjVersion = '1.9.3'
commonsDdbcpVersion = '2.6.0'
commonsIoVersion = '2.6'
commonsLangVersion = '3.8.1'
commonsPoolVersion = '1.6'
derbyVersion = '10.14.2.0'
groovyVersion = '2.5.6'
hamcrestVersion = '1.3'
h2databaseVersion = '1.4.199'
hibernateVersion = '5.4.2.Final'
hibernateValidatorVersion = '6.0.16.Final'
javaxElVersion = '3.0.0'
hsqldbVersion = '2.4.1'
jackson2Version = '2.9.8'
gsonVersion = '2.8.5'
javaMailVersion = '1.6.2'
javaxBatchApiVersion = '1.0'
javaxAnnotationApiVersion = '1.3.2'
javaxInjectVersion = '1'
javaxTransactionVersion = '1.3'
jbatchTckSpi = '1.0'
jettisonVersion = '1.2' //? => upgrade to 1.4 and the build fails (deprecated anyway via xstream)
jmsVersion = '2.0.1'
junitVersion = '4.12'
log4jVersion = '2.11.2'
mysqlVersion = '8.0.15'
mockitoVersion = '2.25.1'
postgresqlVersion = '42.2.5'
quartzVersion = '2.3.1'
servletApiVersion = '4.0.1'
sqlfireclientVersion = '1.0.3'
sqliteVersion = '3.27.2'
woodstoxVersion = '5.2.0'
xmlunitVersion = '2.6.2'
xstreamVersion = '1.4.11.1'
jrubyVersion = '1.7.27'
beanshellVersion = '2.0b5'
jaxbApiVersion = '2.3.1'
jaxbImplVersion = '2.3.0.1'
micrometerVersion = '1.1.4'
docResourcesVersion = '0.1.1.RELEASE'
}
apply plugin: 'idea'
}
configure(subprojects - project(":spring-build-src")) { subproject ->
apply plugin: 'java'
apply from: "${rootProject.projectDir}/publish-maven.gradle"
apply plugin: 'jacoco'
apply plugin: 'propdeps-idea'
apply plugin: 'propdeps-eclipse'
apply plugin: 'merge'
jacoco {
toolVersion = "0.8.2"
}
compileJava {
sourceCompatibility=1.8
targetCompatibility=1.8
options.encoding='UTF-8'
}
compileTestJava {
sourceCompatibility=1.8
targetCompatibility=1.8
options.encoding='UTF-8'
}
eclipse {
project {
natures += 'org.springframework.ide.eclipse.core.springnature'
}
}
sourceSets {
test {
resources {
srcDirs = ['src/test/resources', 'src/test/java']
}
}
}
// enable all compiler warnings; individual projects may customize further
ext.xLintArg = '-Xlint:all'
[compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg] + '-proc:none'
tasks.withType(Test).all {
// suppress all console output during testing unless running `gradle -i`
logging.captureStandardOutput(LogLevel.INFO)
systemProperty "ENVIRONMENT", environmentProperty
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
include '**/*Tests.class'
exclude '**/Abstract*.class'
}
test {
jacoco {
append = false
destinationFile = file("$buildDir/jacoco.exec")
}
// testLogging {
// showStandardStreams = true
// }
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allJava
}
task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
}
task checkTestConfigs {
doLast {
def configFiles = []
sourceSets.test.java.srcDirs.each {
fileTree(it).include('**/*.xml').exclude('**/log4j.xml').each { configFile ->
def configXml = new XmlParser(false, false).parse(configFile)
if (configXml.@'xsi:schemaLocation' ==~ /.*spring-[a-z-]*\d\.\d\.xsd.*/) {
configFiles << configFile
}
}
}
if (configFiles) {
throw new InvalidUserDataException('Hardcoded XSD version in the config files:\n' +
configFiles.collect { relativePath(it) }.join('\n') +
'\nPlease, use versionless schemaLocations for Spring XSDs to avoid issues with builds on different versions of dependencies.')
}
}
}
jar {
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
from("${rootProject.projectDir}/src/dist") {
include "license.txt"
include "notice.txt"
into "META-INF"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
}
test.dependsOn checkTestConfigs
artifacts {
archives sourcesJar
archives javadocJar
}
}
subprojects {
task allDeps(type: DependencyReportTask) {}
}
configure(mainProjects) {
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'
repositories {
maven { url "https://repo.spring.io/libs-snapshot" }
}
dependencyManagement {
springIoTestRuntime {
imports {
mavenBom "io.spring.platform:platform-bom:${platformVersion}"
}
}
}
}
}
project("spring-build-src") {
description = "Exposes gradle buildSrc for IDE support"
apply plugin: "groovy"
dependencies {
compile gradleApi()
compile localGroovy()
}
configurations.archives.artifacts.clear()
}
project('spring-batch-core') {
description = 'Spring Batch Core'
dependencies {
compile project(":spring-batch-infrastructure")
compile "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}"
compile ("org.codehaus.jettison:jettison:$jettisonVersion") {
exclude group: 'stax', module: 'stax-api'
}
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework:spring-beans:$springVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "javax.batch:javax.batch-api:$javaxBatchApiVersion"
compile "io.micrometer:micrometer-core:$micrometerVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "javax.inject:javax.inject:$javaxInjectVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
optional "com.ibm.jbatch:com.ibm.jbatch-tck-spi:$jbatchTckSpi"
optional "com.thoughtworks.xstream:xstream:$xstreamVersion"
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "org.aspectj:aspectjweaver:$aspectjVersion"
optional "org.springframework:spring-jdbc:$springVersion"
optional "org.apache.logging.log4j:log4j-api:$log4jVersion"
optional "org.apache.logging.log4j:log4j-core:$log4jVersion"
optional "javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion"
// JSR-305 only used for non-required meta-annotations
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
}
}
project('spring-batch-infrastructure') {
description = 'Spring Batch Infrastructure'
dependencies {
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework.retry:spring-retry:$springRetryVersion"
testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.aspectj:aspectjrt:$aspectjVersion"
testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.xerial:sqlite-jdbc:$sqliteVersion"
testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
testRuntime "org.jruby:jruby:$jrubyVersion"
testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
testRuntime "org.glassfish:javax.el:$javaxElVersion"
testRuntime "org.beanshell:bsh:$beanshellVersion"
testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion"
testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
optional "javax.jms:javax.jms-api:$jmsVersion"
optional "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}"
optional "com.google.code.gson:gson:${gsonVersion}"
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
optional "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
optional "javax.transaction:javax.transaction-api:$javaxTransactionVersion"
optional "javax.mail:javax.mail-api:$javaMailVersion"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
compile("org.springframework:spring-oxm:$springVersion") { dep ->
optional dep
exclude group: 'commons-lang', module: 'commons-lang'
}
optional "org.springframework:spring-aop:$springVersion"
optional "org.springframework:spring-context:$springVersion"
compile("org.springframework:spring-context-support:$springVersion") { dep ->
optional dep
}
optional "org.springframework:spring-jdbc:$springVersion"
optional "org.springframework:spring-jms:$springVersion"
optional "org.springframework:spring-orm:$springVersion"
optional "org.springframework:spring-tx:$springVersion"
optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion"
optional ("org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion") {
exclude group: "org.springframework", module: "spring-aspects"
}
optional "org.springframework.data:spring-data-gemfire:$springDataGemfireVersion"
compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { dep ->
optional dep
exclude group: 'stax', module: 'stax-api'
}
optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") {
exclude group: "org.springframework", module: "spring-messaging"
exclude group: "org.springframework", module: "spring-web"
}
optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
// JSR-305 only used for non-required meta-annotations
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
}
if (project.hasProperty('platformVersion')) {
def dataNeo4jVersion = dependencyManagement.springIoTestRuntime.managedVersions['org.springframework.data:spring-data-neo4j']
if (dataNeo4jVersion?.startsWith('4.')) {
tasks.withType(Test).matching { it.name =~ "springIoJdk.Test" }.all {
exclude '**/Neo4jItemReaderTests.class'
}
}
}
}
project('spring-batch-docs') {
description = 'Spring Batch Docs'
}
project('spring-batch-core-tests') {
description = 'Spring Batch Core Tests'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-core")
compile project(":spring-batch-infrastructure")
compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework.retry:spring-retry:$springRetryVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "org.springframework:spring-jdbc:$springVersion"
runtime "mysql:mysql-connector-java:$mysqlVersion"
runtime "org.postgresql:postgresql:$postgresqlVersion"
runtime "javax.batch:javax.batch-api:$javaxBatchApiVersion"
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "org.aspectj:aspectjweaver:$aspectjVersion"
optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
}
test {
enabled = project.hasProperty('alltests')
}
}
project('spring-batch-infrastructure-tests') {
description = 'Spring Batch Infrastructure Tests'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-infrastructure")
compile "javax.jms:javax.jms-api:$jmsVersion"
compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "commons-io:commons-io:$commonsIoVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1"
testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
testCompile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") {
exclude group: 'stax', module: 'stax-api'
}
testCompile "org.apache.commons:commons-lang3:$commonsLangVersion"
testCompile("org.springframework:spring-oxm:$springVersion") {
exclude group: 'commons-lang', module: 'commons-lang'
}
testCompile "org.springframework:spring-jdbc:$springVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
optional "javax.transaction:javax.transaction-api:1.2"
optional "org.springframework:spring-orm:$springVersion"
optional "org.springframework:spring-jms:$springVersion"
runtime "mysql:mysql-connector-java:$mysqlVersion"
runtime "org.postgresql:postgresql:$postgresqlVersion"
}
test {
enabled = project.hasProperty('alltests')
}
}
//Domain for batch job testing
project('spring-batch-test') {
description = 'Spring Batch Test'
dependencies {
compile project(":spring-batch-core")
compile "junit:junit:${junitVersion}"
compile "org.springframework:spring-test:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
optional "org.aspectj:aspectjrt:$aspectjVersion"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
}
}
project('spring-batch-integration') {
description = 'Batch Integration'
dependencies {
compile project(":spring-batch-core")
compile "org.springframework.retry:spring-retry:$springRetryVersion"
compile "org.springframework:spring-context:$springVersion"
compile "org.springframework:spring-messaging:$springVersion"
compile "org.springframework:spring-aop:$springVersion"
compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
compile "org.springframework:spring-tx:$springVersion"
testCompile project(":spring-batch-test")
testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.aspectj:aspectjrt:$aspectjVersion"
testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
testCompile "com.h2database:h2:$h2databaseVersion"
testCompile "mysql:mysql-connector-java:$mysqlVersion"
testCompile "org.apache.derby:derby:$derbyVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile("org.springframework.integration:spring-integration-test:$springIntegrationVersion") {
exclude group: 'junit', module: 'junit-dep'
exclude group:'org.hamcrest', module:'hamcrest-all'
}
testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion"
optional "javax.jms:javax.jms-api:$jmsVersion"
optional "org.apache.logging.log4j:log4j-api:$log4jVersion"
optional "org.apache.logging.log4j:log4j-core:$log4jVersion"
optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
optional "org.springframework:spring-jms:$springVersion"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
// JSR-305 only used for non-required meta-annotations
compileOnly("com.google.code.findbugs:jsr305:3.0.2")
}
}
project('spring-batch-samples') {
description = 'Batch Batch Samples'
project.tasks.findByPath("artifactoryPublish")?.enabled = false
dependencies {
compile project(":spring-batch-integration")
compile "org.aspectj:aspectjrt:$aspectjVersion"
compile "org.aspectj:aspectjweaver:$aspectjVersion"
compile "org.quartz-scheduler:quartz:$quartzVersion"
compile "commons-io:commons-io:$commonsIoVersion"
compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") {
exclude group: 'stax', module: 'stax-api'
}
compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
optional dep
exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
}
compile "javax.transaction:javax.transaction-api:$javaxTransactionVersion"
compile "org.springframework:spring-aop:$springVersion"
compile("org.springframework:spring-oxm:$springVersion") {
exclude group: 'commons-lang', module: 'commons-lang'
}
compile "org.springframework:spring-core:$springVersion"
compile "org.springframework:spring-context-support:$springVersion"
compile "org.springframework:spring-jdbc:$springVersion"
compile "org.springframework:spring-orm:$springVersion"
compile "org.springframework:spring-tx:$springVersion"
compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
compile "javax.mail:javax.mail-api:$javaMailVersion"
compile "org.apache.activemq:activemq-client:$activemqVersion"
compile "org.apache.activemq:activemq-broker:$activemqVersion"
testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
testCompile project(":spring-batch-test")
testCompile "junit:junit:${junitVersion}"
testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
testCompile "org.codehaus.groovy:groovy:$groovyVersion"
testCompile "org.codehaus.groovy:groovy-ant:$groovyVersion"
testCompile "org.springframework:spring-test:$springVersion"
testCompile "org.mockito:mockito-core:$mockitoVersion"
testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
testRuntime "org.glassfish:javax.el:$javaxElVersion"
testRuntime "javax.xml.bind:jaxb-api:$jaxbApiVersion"
testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion"
testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
provided "mysql:mysql-connector-java:$mysqlVersion"
provided "com.h2database:h2:$h2databaseVersion"
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion"
optional "org.apache.derby:derby:$derbyVersion"
optional "org.postgresql:postgresql:$postgresqlVersion"
optional "org.springframework:spring-web:$springVersion"
optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") {
exclude group: "org.springframework", module: "spring-messaging"
exclude group: "org.springframework", module: "spring-web"
}
optional "javax.inject:javax.inject:1"
optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
}
}
apply plugin: "org.asciidoctor.convert"
asciidoctorj {
version = '1.5.5'
}
configurations {
docs
}
dependencies {
docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
}
task prepareAsciidocBuild(type: Sync) {
dependsOn configurations.docs
// copy doc resources
from {
configurations.docs.collect { zipTree(it) }
}
// and doc sources
from "spring-batch-docs/asciidoc/"
// to a build directory of your choice
into "$buildDir/asciidoc/assemble"
}
task('makePDF', type: org.asciidoctor.gradle.AsciidoctorTask){
dependsOn prepareAsciidocBuild
backends 'pdf'
sourceDir "$buildDir/asciidoc/assemble"
sources {
include 'index-single.adoc'
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'icons': 'font',
'sectanchors': '',
'sectnums': '',
'toc': '',
'source-highlighter' : 'coderay',
revnumber: project.version
}
asciidoctor {
dependsOn makePDF
backends 'html5'
sourceDir "$buildDir/asciidoc/assemble"
resources {
from(sourceDir) {
include 'images/*', 'css/**', 'js/**'
}
}
options doctype: 'book', eruby: 'erubis'
logDocuments = true
attributes 'docinfo': 'shared',
// use provided stylesheet
stylesdir: "css/",
stylesheet: 'spring.css',
'linkcss': true,
'icons': 'font',
'sectanchors': '',
// use provided highlighter
'source-highlighter=highlight.js',
'highlightjsdir=js/highlight',
'highlightjs-theme=atom-one-dark-reasonable',
'idprefix': '',
'idseparator': '-',
'spring-version': project.version,
'allow-uri-read': '',
revnumber: project.version
}
apply plugin: 'org.sonarqube'
sonarqube {
properties {
property "sonar.projectName", "Spring Batch"
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
property "sonar.links.issue", linkIssue
property "sonar.links.scm", linkScmUrl
property "sonar.links.scm_dev", linkScmDevConnection
property "sonar.java.coveragePlugin", "jacoco"
}
}
task api(type: Javadoc) {
group = 'Documentation'
description = 'Generates aggregated Javadoc API documentation.'
title = "Spring Batch ${version} API"
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
options.author = true
options.header = 'Spring Batch'
options.overview = 'src/api/overview.html'
if (JavaVersion.current().isJava8Compatible()) {
options.addStringOption('Xdoclint:none', '-quiet')
}
source subprojects.collect { project ->
project.sourceSets.main.allJava
}
destinationDir = new File(buildDir, "api")
classpath = files(subprojects.collect { project ->
project.sourceSets.main.compileClasspath
})
}
task schemaZip(type: Zip) {
group = 'Distribution'
classifier = 'schema'
description = "Builds -${classifier} archive containing all " +
"XSDs for deployment at static.springframework.org/schema."
subprojects.each { subproject ->
def Properties schemas = new Properties();
def shortName = subproject.name.replaceFirst("${rootProject.name}-", '')
if (subproject.name.endsWith("-core")) {
shortName = ''
}
subproject.sourceSets.main.resources.find {
it.path.endsWith("META-INF${File.separator}spring.schemas")
}?.withInputStream { schemas.load(it) }
for (def key : schemas.keySet()) {
File xsdFile = subproject.sourceSets.main.resources.find {
it.path.replaceAll('\\\\', '/').endsWith(schemas.get(key))
}
assert xsdFile != null
into ("batch/${shortName}") {
from xsdFile.path
}
}
}
}
task docsZip(type: Zip) {
group = 'Distribution'
classifier = 'docs'
description = "Builds -${classifier} archive containing api and reference " +
"for deployment at static.springframework.org/spring-batch/reference."
from('src/dist') {
include 'changelog.txt'
}
from (api) {
into 'api'
}
from (makePDF) {
include "index-single.pdf"
rename 'index-single.pdf', 'spring-batch-reference.pdf'
into 'reference/pdf'
}
from (asciidoctor) {
include "*.html"
include "css/**"
include "js/**"
include "images/**"
into 'reference/html'
}
}
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
group = 'Distribution'
classifier = 'dist'
description = "Builds -${classifier} archive, containing all jars and docs, " +
"suitable for community download page."
ext.baseDir = "${project.name}-${project.version}";
from('src/dist') {
include 'readme.txt'
include 'license.txt'
include 'notice.txt'
into "${baseDir}"
expand(copyright: new Date().format("yyyy"), version: project.version)
}
from(zipTree(docsZip.archivePath)) {
into "${baseDir}/docs"
}
from(zipTree(schemaZip.archivePath)) {
into "${baseDir}/schema"
}
[project(':spring-batch-core'), project(':spring-batch-infrastructure'), project(':spring-batch-test'), project(':spring-batch-integration')].each { subproject ->
into ("${baseDir}/libs") {
from subproject.jar
from subproject.sourcesJar
from subproject.javadocJar
}
}
}
// Create an optional "with dependencies" distribution.
// Not published by default; only for use when building from source.
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
group = 'Distribution'
classifier = 'dist-with-deps'
description = "Builds -${classifier} archive, containing everything " +
"in the -${distZip.classifier} archive plus all 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 ->
subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
def dependency = artifact.moduleVersion.id
if (!projectNames.contains(dependency.name)) {
artifacts << artifact.file
}
}
}
zipTask.from(artifacts) {
into "${distZip.baseDir}/deps"
}
}
}
}
artifacts {
archives distZip
archives docsZip
archives schemaZip
}
task dist(dependsOn: assemble) {
group = 'Distribution'
description = 'Builds -dist, -docs and -schema distribution archives.'
}
task runTck(dependsOn: subprojects.compileJava) {
configurations {
tck {
transitive = true
}
antcp {
transitive = true
exclude module: 'ant'
}
}
dependencies {
tck project(":spring-batch-core")
tck "commons-pool:commons-pool:$commonsPoolVersion"
tck "javax.batch:javax.batch-api:$javaxBatchApiVersion"
tck "org.springframework:spring-core:$springVersion"
tck "org.springframework:spring-context:$springVersion"
tck "org.springframework:spring-beans:$springVersion"
tck 'commons-logging:commons-logging-api:1.1'
tck "org.springframework:spring-aop:$springVersion"
tck "org.springframework:spring-tx:$springVersion"
tck "org.springframework.retry:spring-retry:$springRetryVersion"
tck "org.hsqldb:hsqldb:$hsqldbVersion"
tck "org.springframework:spring-jdbc:$springVersion"
tck "com.thoughtworks.xstream:xstream:$xstreamVersion"
tck "org.codehaus.jettison:jettison:$jettisonVersion"
tck "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
tck "org.apache.derby:derby:$derbyVersion"
antcp "ant-contrib:ant-contrib:1.0b3"
}
doLast {
logger.info('tck dependencies: ' + configurations.tck.asPath)
def tckHome = project.hasProperty('TCK_HOME') ? getProperty('TCK_HOME') : System.getenv("JSR_352_TCK_HOME")
assert tckHome : '''\
tckHome is not set. Please set either the environment variable 'JSR_352_TCK_HOME'
or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/path/to/tck'''
println "Using the JSR 352 TCK at: '$tckHome'"
ant.taskdef resource: "net/sf/antcontrib/antcontrib.properties",
classpath: configurations.antcp.asPath
ant.properties['batch.impl.classes'] = configurations.tck.asPath
ant.ant antfile: "$tckHome/build.xml", target: "run", dir: "$tckHome"
}
}
wrapper {
description = 'Generates gradlew[.bat] scripts'
gradleVersion = '4.10.3'
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/vincentjava/spring-batch.git
[email protected]:vincentjava/spring-batch.git
vincentjava
spring-batch
spring-batch
master

搜索帮助