PageRenderTime 43ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/build.gradle

http://github.com/SpringSource/spring-batch
Gradle | 953 lines | 838 code | 99 blank | 16 comment | 0 complexity | 97279dc63ebd9fdb31e76a9aa98e87c4 MD5 | raw file
  1. //description = 'Spring Batch'
  2. //apply plugin: 'base'
  3. buildscript {
  4. repositories {
  5. maven { url 'https://repo.spring.io/plugins-release' }
  6. maven { url 'https://plugins.gradle.org/m2/' }
  7. }
  8. dependencies {
  9. classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.7'
  10. classpath 'io.spring.gradle:spring-io-plugin:0.0.5.RELEASE'
  11. classpath "io.spring.gradle:dependency-management-plugin:0.6.0.RELEASE"
  12. classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2"
  13. classpath "org.asciidoctor:asciidoctor-gradle-plugin:1.5.6"
  14. classpath "org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16"
  15. }
  16. }
  17. plugins {
  18. id 'org.sonarqube' version '2.6.2'
  19. }
  20. ext {
  21. linkHomepage = 'https://projects.spring.io/spring-batch/'
  22. linkCi = 'https://build.spring.io/browse/BATCH'
  23. linkIssue = 'https://github.com/spring-projects/spring-batch/issues'
  24. linkScmUrl = 'https://github.com/spring-projects/spring-batch'
  25. linkScmConnection = 'git://github.com/spring-projects/spring-batch.git'
  26. linkScmDevConnection = 'git@github.com:spring-projects/spring-batch.git'
  27. mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') && it.name.startsWith('spring-batch-')}
  28. }
  29. allprojects {
  30. group = 'org.springframework.batch'
  31. repositories {
  32. maven { url 'https://repo.spring.io/libs-snapshot' }
  33. maven { url 'https://repo.spring.io/libs-milestone' }
  34. maven { url 'https://repo.spring.io/plugins-release' }
  35. mavenCentral()
  36. }
  37. ext {
  38. environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
  39. springVersionDefault = '5.2.4.BUILD-SNAPSHOT'
  40. springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
  41. springRetryVersion = '1.2.5.RELEASE'
  42. springAmqpVersion = '2.2.4.BUILD-SNAPSHOT'
  43. springDataCommonsVersion = '2.3.0.BUILD-SNAPSHOT'
  44. springDataGemfireVersion = '2.3.0.BUILD-SNAPSHOT'
  45. springDataJpaVersion = '2.3.0.BUILD-SNAPSHOT'
  46. springDataMongodbVersion = '3.0.0.BUILD-SNAPSHOT'
  47. springDataNeo4jVersion = '5.3.0.BUILD-SNAPSHOT'
  48. springIntegrationVersion = '5.3.0.BUILD-SNAPSHOT'
  49. springKafkaVersion = '2.4.2.BUILD-SNAPSHOT'
  50. springLdapVersion = '2.3.2.RELEASE'
  51. activemqVersion = '5.15.11'
  52. apacheAvroVersion ='1.9.1'
  53. aspectjVersion = '1.9.5'
  54. commonsDdbcpVersion = '2.7.0'
  55. commonsIoVersion = '2.6'
  56. commonsLangVersion = '3.9'
  57. commonsPoolVersion = '1.6'
  58. derbyVersion = '10.14.2.0'
  59. groovyVersion = '2.5.10'
  60. hamcrestVersion = '2.2'
  61. h2databaseVersion = '1.4.200'
  62. hibernateVersion = '5.4.9.Final'
  63. hibernateValidatorVersion = '6.1.0.Final'
  64. javaxElVersion = '3.0.0'
  65. hsqldbVersion = '2.5.0'
  66. jackson2Version = '2.10.1'
  67. gsonVersion = '2.8.6'
  68. javaMailVersion = '1.6.2'
  69. javaxBatchApiVersion = '1.0'
  70. javaxAnnotationApiVersion = '1.3.2'
  71. javaxInjectVersion = '1'
  72. javaxTransactionVersion = '1.3'
  73. jbatchTckSpi = '1.0'
  74. jettisonVersion = '1.2' //? => upgrade to 1.4 and the build fails (deprecated anyway via xstream)
  75. jmsVersion = '2.0.1'
  76. junitVersion = '4.13'
  77. junitJupiterVersion = '5.6.2'
  78. log4jVersion = '2.13.0'
  79. mysqlVersion = '8.0.18'
  80. mockitoVersion = '3.1.0'
  81. postgresqlVersion = '42.2.8'
  82. quartzVersion = '2.3.2'
  83. servletApiVersion = '4.0.1'
  84. sqlfireclientVersion = '1.0.3'
  85. sqliteVersion = '3.30.1'
  86. woodstoxVersion = '5.2.0'
  87. xmlunitVersion = '2.6.3'
  88. xstreamVersion = '1.4.11.1'
  89. jrubyVersion = '1.7.27'
  90. beanshellVersion = '2.0b5'
  91. jaxbApiVersion = '2.3.1'
  92. jaxbImplVersion = '2.3.0.1'
  93. micrometerVersion = '1.3.3'
  94. prometheusPushgatewayVersion = '0.8.0'
  95. docResourcesVersion = '0.2.1.RELEASE'
  96. assertjVersion='3.15.0'
  97. mongoDbDriverSyncVersion='4.0.0-beta1'
  98. }
  99. apply plugin: 'idea'
  100. }
  101. configure(subprojects - project(":spring-build-src")) { subproject ->
  102. apply plugin: 'java'
  103. apply from: "${rootProject.projectDir}/publish-maven.gradle"
  104. apply plugin: 'jacoco'
  105. apply plugin: 'propdeps-idea'
  106. apply plugin: 'propdeps-eclipse'
  107. apply plugin: 'merge'
  108. jacoco {
  109. toolVersion = "0.8.5"
  110. }
  111. compileJava {
  112. sourceCompatibility=1.8
  113. targetCompatibility=1.8
  114. options.encoding='UTF-8'
  115. }
  116. compileTestJava {
  117. sourceCompatibility=1.8
  118. targetCompatibility=1.8
  119. options.encoding='UTF-8'
  120. }
  121. eclipse {
  122. project {
  123. natures += 'org.springframework.ide.eclipse.core.springnature'
  124. }
  125. }
  126. sourceSets {
  127. test {
  128. resources {
  129. srcDirs = ['src/test/resources', 'src/test/java']
  130. }
  131. }
  132. }
  133. // enable all compiler warnings; individual projects may customize further
  134. ext.xLintArg = '-Xlint:all'
  135. [compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg] + '-proc:none'
  136. tasks.withType(Test).all {
  137. // suppress all console output during testing unless running `gradle -i`
  138. logging.captureStandardOutput(LogLevel.INFO)
  139. systemProperty "ENVIRONMENT", environmentProperty
  140. jacoco {
  141. destinationFile = file("$buildDir/jacoco.exec")
  142. }
  143. include '**/*Tests.class'
  144. exclude '**/Abstract*.class'
  145. }
  146. test {
  147. jacoco {
  148. destinationFile = file("$buildDir/jacoco.exec")
  149. }
  150. // testLogging {
  151. // showStandardStreams = true
  152. // }
  153. }
  154. task sourcesJar(type: Jar) {
  155. classifier = 'sources'
  156. from sourceSets.main.allJava
  157. }
  158. task javadocJar(type: Jar) {
  159. classifier = 'javadoc'
  160. from javadoc
  161. }
  162. task checkTestConfigs {
  163. doLast {
  164. def configFiles = []
  165. sourceSets.test.java.srcDirs.each {
  166. fileTree(it).include('**/*.xml').exclude('**/log4j.xml').each { configFile ->
  167. def configXml = new XmlParser(false, false).parse(configFile)
  168. if (configXml.@'xsi:schemaLocation' ==~ /.*spring-[a-z-]*\d\.\d\.xsd.*/) {
  169. configFiles << configFile
  170. }
  171. }
  172. }
  173. if (configFiles) {
  174. throw new InvalidUserDataException('Hardcoded XSD version in the config files:\n' +
  175. configFiles.collect { relativePath(it) }.join('\n') +
  176. '\nPlease, use versionless schemaLocations for Spring XSDs to avoid issues with builds on different versions of dependencies.')
  177. }
  178. }
  179. }
  180. jar {
  181. manifest.attributes["Created-By"] =
  182. "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
  183. manifest.attributes["Implementation-Title"] = subproject.name
  184. manifest.attributes["Implementation-Version"] = subproject.version
  185. from("${rootProject.projectDir}/src/dist") {
  186. include "license.txt"
  187. include "notice.txt"
  188. into "META-INF"
  189. expand(copyright: new Date().format("yyyy"), version: project.version)
  190. }
  191. }
  192. test.dependsOn checkTestConfigs
  193. artifacts {
  194. archives sourcesJar
  195. archives javadocJar
  196. }
  197. }
  198. subprojects {
  199. task allDeps(type: DependencyReportTask) {}
  200. }
  201. configure(mainProjects) {
  202. if (project.hasProperty('platformVersion')) {
  203. apply plugin: 'spring-io'
  204. repositories {
  205. maven { url "https://repo.spring.io/libs-snapshot" }
  206. }
  207. dependencyManagement {
  208. springIoTestRuntime {
  209. imports {
  210. mavenBom "io.spring.platform:platform-bom:${platformVersion}"
  211. }
  212. }
  213. }
  214. }
  215. }
  216. project("spring-build-src") {
  217. description = "Exposes gradle buildSrc for IDE support"
  218. apply plugin: "groovy"
  219. dependencies {
  220. compile gradleApi()
  221. compile localGroovy()
  222. }
  223. configurations.archives.artifacts.clear()
  224. }
  225. project('spring-batch-core') {
  226. description = 'Spring Batch Core'
  227. dependencies {
  228. compile project(":spring-batch-infrastructure")
  229. compile "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}"
  230. compile ("org.codehaus.jettison:jettison:$jettisonVersion") {
  231. exclude group: 'stax', module: 'stax-api'
  232. }
  233. compile "org.springframework:spring-aop:$springVersion"
  234. compile "org.springframework:spring-beans:$springVersion"
  235. compile "org.springframework:spring-context:$springVersion"
  236. compile "org.springframework:spring-core:$springVersion"
  237. compile "org.springframework:spring-tx:$springVersion"
  238. compile "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  239. compile "io.micrometer:micrometer-core:$micrometerVersion"
  240. testCompile "org.springframework:spring-test:$springVersion"
  241. testCompile "org.mockito:mockito-core:$mockitoVersion"
  242. testCompile "javax.inject:javax.inject:$javaxInjectVersion"
  243. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  244. testCompile "com.h2database:h2:$h2databaseVersion"
  245. testCompile "commons-io:commons-io:$commonsIoVersion"
  246. testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  247. testCompile "junit:junit:${junitVersion}"
  248. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  249. optional "com.ibm.jbatch:com.ibm.jbatch-tck-spi:$jbatchTckSpi"
  250. optional "com.thoughtworks.xstream:xstream:$xstreamVersion"
  251. optional "org.aspectj:aspectjrt:$aspectjVersion"
  252. optional "org.aspectj:aspectjweaver:$aspectjVersion"
  253. optional "org.springframework:spring-jdbc:$springVersion"
  254. optional "org.apache.logging.log4j:log4j-api:$log4jVersion"
  255. optional "org.apache.logging.log4j:log4j-core:$log4jVersion"
  256. optional "javax.annotation:javax.annotation-api:$javaxAnnotationApiVersion"
  257. // JSR-305 only used for non-required meta-annotations
  258. compileOnly("com.google.code.findbugs:jsr305:3.0.2")
  259. testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
  260. }
  261. }
  262. project('spring-batch-infrastructure') {
  263. description = 'Spring Batch Infrastructure'
  264. dependencies {
  265. compile "org.springframework:spring-core:$springVersion"
  266. compile "org.springframework.retry:spring-retry:$springRetryVersion"
  267. testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
  268. testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
  269. testCompile "commons-io:commons-io:$commonsIoVersion"
  270. testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  271. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  272. testCompile "com.h2database:h2:$h2databaseVersion"
  273. testCompile "org.apache.derby:derby:$derbyVersion"
  274. testCompile "org.springframework:spring-test:$springVersion"
  275. testCompile "junit:junit:${junitVersion}"
  276. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  277. testCompile "org.aspectj:aspectjrt:$aspectjVersion"
  278. testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
  279. testCompile "org.mockito:mockito-core:$mockitoVersion"
  280. testCompile "org.xerial:sqlite-jdbc:$sqliteVersion"
  281. testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
  282. testCompile "org.springframework.kafka:spring-kafka-test:$springKafkaVersion"
  283. testCompile "org.assertj:assertj-core:$assertjVersion"
  284. testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
  285. testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
  286. testRuntime "org.jruby:jruby:$jrubyVersion"
  287. testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
  288. testRuntime "org.glassfish:javax.el:$javaxElVersion"
  289. testRuntime "org.beanshell:bsh:$beanshellVersion"
  290. testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion"
  291. testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
  292. testRuntime "org.mongodb:mongodb-driver-sync:$mongoDbDriverSyncVersion"
  293. optional "javax.jms:javax.jms-api:$jmsVersion"
  294. optional "com.fasterxml.jackson.core:jackson-databind:${jackson2Version}"
  295. optional "com.google.code.gson:gson:${gsonVersion}"
  296. compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
  297. optional dep
  298. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  299. }
  300. compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
  301. optional dep
  302. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  303. }
  304. optional "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
  305. optional "javax.transaction:javax.transaction-api:$javaxTransactionVersion"
  306. optional "javax.mail:javax.mail-api:$javaMailVersion"
  307. optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  308. compile("org.springframework:spring-oxm:$springVersion") { dep ->
  309. optional dep
  310. exclude group: 'commons-lang', module: 'commons-lang'
  311. }
  312. optional "org.springframework:spring-aop:$springVersion"
  313. optional "org.springframework:spring-context:$springVersion"
  314. compile("org.springframework:spring-context-support:$springVersion") { dep ->
  315. optional dep
  316. }
  317. optional "org.springframework:spring-jdbc:$springVersion"
  318. optional "org.springframework:spring-jms:$springVersion"
  319. optional "org.springframework:spring-orm:$springVersion"
  320. optional "org.springframework:spring-tx:$springVersion"
  321. optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
  322. optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion"
  323. optional ("org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion") {
  324. exclude group: "org.springframework", module: "spring-aspects"
  325. }
  326. optional "org.springframework.data:spring-data-gemfire:$springDataGemfireVersion"
  327. compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") { dep ->
  328. optional dep
  329. exclude group: 'stax', module: 'stax-api'
  330. }
  331. optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
  332. optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") {
  333. exclude group: "org.springframework", module: "spring-messaging"
  334. exclude group: "org.springframework", module: "spring-web"
  335. }
  336. optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
  337. optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
  338. optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
  339. optional "org.springframework.kafka:spring-kafka:$springKafkaVersion"
  340. optional "org.apache.avro:avro:$apacheAvroVersion"
  341. // JSR-305 only used for non-required meta-annotations
  342. compileOnly("com.google.code.findbugs:jsr305:3.0.2")
  343. testCompileOnly("com.google.code.findbugs:jsr305:3.0.2")
  344. }
  345. if (project.hasProperty('platformVersion')) {
  346. def dataNeo4jVersion = dependencyManagement.springIoTestRuntime.managedVersions['org.springframework.data:spring-data-neo4j']
  347. if (dataNeo4jVersion?.startsWith('4.')) {
  348. tasks.withType(Test).matching { it.name =~ "springIoJdk.Test" }.all {
  349. exclude '**/Neo4jItemReaderTests.class'
  350. }
  351. }
  352. }
  353. }
  354. project('spring-batch-docs') {
  355. description = 'Spring Batch Docs'
  356. }
  357. project('spring-batch-core-tests') {
  358. description = 'Spring Batch Core Tests'
  359. project.tasks.findByPath("artifactoryPublish")?.enabled = false
  360. dependencies {
  361. compile project(":spring-batch-core")
  362. compile project(":spring-batch-infrastructure")
  363. compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  364. compile "org.springframework:spring-jdbc:$springVersion"
  365. compile "org.springframework.retry:spring-retry:$springRetryVersion"
  366. compile "org.springframework:spring-tx:$springVersion"
  367. compile "org.springframework:spring-aop:$springVersion"
  368. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  369. testCompile "commons-io:commons-io:$commonsIoVersion"
  370. testCompile "org.apache.derby:derby:$derbyVersion"
  371. testCompile "junit:junit:${junitVersion}"
  372. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  373. testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
  374. testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
  375. testCompile "org.springframework:spring-test:$springVersion"
  376. testCompile "org.springframework:spring-jdbc:$springVersion"
  377. runtime "mysql:mysql-connector-java:$mysqlVersion"
  378. runtime "org.postgresql:postgresql:$postgresqlVersion"
  379. runtime "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  380. optional "org.aspectj:aspectjrt:$aspectjVersion"
  381. optional "org.aspectj:aspectjweaver:$aspectjVersion"
  382. optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
  383. optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
  384. optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
  385. }
  386. test {
  387. enabled = project.hasProperty('alltests')
  388. }
  389. }
  390. project('spring-batch-infrastructure-tests') {
  391. description = 'Spring Batch Infrastructure Tests'
  392. project.tasks.findByPath("artifactoryPublish")?.enabled = false
  393. dependencies {
  394. compile project(":spring-batch-infrastructure")
  395. compile "javax.jms:javax.jms-api:$jmsVersion"
  396. compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  397. compile "org.springframework:spring-tx:$springVersion"
  398. compile "org.springframework:spring-aop:$springVersion"
  399. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  400. testCompile "commons-io:commons-io:$commonsIoVersion"
  401. testCompile "org.apache.derby:derby:$derbyVersion"
  402. testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
  403. testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
  404. testCompile "junit:junit:${junitVersion}"
  405. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  406. testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1"
  407. testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
  408. testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
  409. testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
  410. testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
  411. testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
  412. testCompile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") {
  413. exclude group: 'stax', module: 'stax-api'
  414. }
  415. testCompile "org.apache.commons:commons-lang3:$commonsLangVersion"
  416. testCompile("org.springframework:spring-oxm:$springVersion") {
  417. exclude group: 'commons-lang', module: 'commons-lang'
  418. }
  419. testCompile "org.springframework:spring-jdbc:$springVersion"
  420. testCompile "org.springframework:spring-test:$springVersion"
  421. testCompile "org.mockito:mockito-core:$mockitoVersion"
  422. testCompile "javax.xml.bind:jaxb-api:$jaxbApiVersion"
  423. compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
  424. optional dep
  425. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  426. }
  427. compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
  428. optional dep
  429. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  430. }
  431. optional "javax.transaction:javax.transaction-api:1.2"
  432. optional "org.springframework:spring-orm:$springVersion"
  433. optional "org.springframework:spring-jms:$springVersion"
  434. runtime "mysql:mysql-connector-java:$mysqlVersion"
  435. runtime "org.postgresql:postgresql:$postgresqlVersion"
  436. }
  437. test {
  438. enabled = project.hasProperty('alltests')
  439. }
  440. }
  441. //Domain for batch job testing
  442. project('spring-batch-test') {
  443. description = 'Spring Batch Test'
  444. dependencies {
  445. compile project(":spring-batch-core")
  446. compile "junit:junit:${junitVersion}"
  447. compile "org.springframework:spring-test:$springVersion"
  448. compile "org.springframework:spring-jdbc:$springVersion"
  449. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  450. testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  451. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  452. testCompile "org.mockito:mockito-core:$mockitoVersion"
  453. testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitJupiterVersion"
  454. optional "org.aspectj:aspectjrt:$aspectjVersion"
  455. optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  456. optional "org.junit.jupiter:junit-jupiter-api:$junitJupiterVersion"
  457. }
  458. }
  459. project('spring-batch-integration') {
  460. description = 'Batch Integration'
  461. dependencies {
  462. compile project(":spring-batch-core")
  463. compile "org.springframework.retry:spring-retry:$springRetryVersion"
  464. compile "org.springframework:spring-context:$springVersion"
  465. compile "org.springframework:spring-messaging:$springVersion"
  466. compile "org.springframework:spring-aop:$springVersion"
  467. compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
  468. compile "org.springframework:spring-tx:$springVersion"
  469. testCompile project(":spring-batch-test")
  470. testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
  471. testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
  472. testCompile "junit:junit:${junitVersion}"
  473. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  474. testCompile "org.aspectj:aspectjrt:$aspectjVersion"
  475. testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
  476. testCompile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  477. testCompile "com.h2database:h2:$h2databaseVersion"
  478. testCompile "mysql:mysql-connector-java:$mysqlVersion"
  479. testCompile "org.apache.derby:derby:$derbyVersion"
  480. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  481. testCompile "org.springframework:spring-test:$springVersion"
  482. testCompile "org.mockito:mockito-core:$mockitoVersion"
  483. testCompile("org.springframework.integration:spring-integration-test:$springIntegrationVersion") {
  484. exclude group: 'junit', module: 'junit-dep'
  485. exclude group:'org.hamcrest', module:'hamcrest-all'
  486. }
  487. testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion"
  488. optional "javax.jms:javax.jms-api:$jmsVersion"
  489. optional "org.apache.logging.log4j:log4j-api:$log4jVersion"
  490. optional "org.apache.logging.log4j:log4j-core:$log4jVersion"
  491. optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
  492. optional "org.springframework:spring-jms:$springVersion"
  493. optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  494. // JSR-305 only used for non-required meta-annotations
  495. compileOnly("com.google.code.findbugs:jsr305:3.0.2")
  496. }
  497. }
  498. project('spring-batch-samples') {
  499. description = 'Batch Batch Samples'
  500. project.tasks.findByPath("artifactoryPublish")?.enabled = false
  501. dependencies {
  502. compile project(":spring-batch-integration")
  503. compile "org.aspectj:aspectjrt:$aspectjVersion"
  504. compile "org.aspectj:aspectjweaver:$aspectjVersion"
  505. compile "org.quartz-scheduler:quartz:$quartzVersion"
  506. compile "commons-io:commons-io:$commonsIoVersion"
  507. compile "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  508. compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
  509. compile("com.fasterxml.woodstox:woodstox-core:$woodstoxVersion") {
  510. exclude group: 'stax', module: 'stax-api'
  511. }
  512. compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
  513. optional dep
  514. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  515. }
  516. compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
  517. optional dep
  518. exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
  519. }
  520. compile "javax.transaction:javax.transaction-api:$javaxTransactionVersion"
  521. compile "org.springframework:spring-aop:$springVersion"
  522. compile("org.springframework:spring-oxm:$springVersion") {
  523. exclude group: 'commons-lang', module: 'commons-lang'
  524. }
  525. compile "org.springframework:spring-core:$springVersion"
  526. compile "org.springframework:spring-context-support:$springVersion"
  527. compile "org.springframework:spring-jdbc:$springVersion"
  528. compile "org.springframework:spring-orm:$springVersion"
  529. compile "org.springframework:spring-tx:$springVersion"
  530. compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
  531. compile "javax.mail:javax.mail-api:$javaMailVersion"
  532. compile "org.apache.activemq:activemq-client:$activemqVersion"
  533. compile "org.apache.activemq:activemq-broker:$activemqVersion"
  534. compile "io.micrometer:micrometer-registry-prometheus:$micrometerVersion"
  535. compile "io.prometheus:simpleclient_pushgateway:$prometheusPushgatewayVersion"
  536. compile "org.mongodb:mongodb-driver-sync:$mongoDbDriverSyncVersion"
  537. testCompile "org.xmlunit:xmlunit-core:$xmlunitVersion"
  538. testCompile "org.xmlunit:xmlunit-matchers:$xmlunitVersion"
  539. testCompile project(":spring-batch-test")
  540. testCompile "junit:junit:${junitVersion}"
  541. testCompile "org.hamcrest:hamcrest-library:$hamcrestVersion"
  542. testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
  543. testCompile "org.apache.logging.log4j:log4j-api:$log4jVersion"
  544. testCompile "org.apache.logging.log4j:log4j-core:$log4jVersion"
  545. testCompile "org.codehaus.groovy:groovy:$groovyVersion"
  546. testCompile "org.codehaus.groovy:groovy-ant:$groovyVersion"
  547. testCompile "org.springframework:spring-test:$springVersion"
  548. testCompile "org.mockito:mockito-core:$mockitoVersion"
  549. testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
  550. testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
  551. testRuntime "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"
  552. testRuntime "org.glassfish:javax.el:$javaxElVersion"
  553. testRuntime "javax.xml.bind:jaxb-api:$jaxbApiVersion"
  554. testRuntime "com.sun.xml.bind:jaxb-core:$jaxbImplVersion"
  555. testRuntime "com.sun.xml.bind:jaxb-impl:$jaxbImplVersion"
  556. provided "mysql:mysql-connector-java:$mysqlVersion"
  557. provided "com.h2database:h2:$h2databaseVersion"
  558. provided "javax.servlet:javax.servlet-api:$servletApiVersion"
  559. optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion"
  560. optional "org.apache.derby:derby:$derbyVersion"
  561. optional "org.postgresql:postgresql:$postgresqlVersion"
  562. optional "org.springframework:spring-web:$springVersion"
  563. optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
  564. optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion"
  565. optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
  566. optional ("org.springframework.amqp:spring-rabbit:$springAmqpVersion") {
  567. exclude group: "org.springframework", module: "spring-messaging"
  568. exclude group: "org.springframework", module: "spring-web"
  569. }
  570. optional "javax.inject:javax.inject:1"
  571. optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  572. }
  573. }
  574. apply plugin: "org.asciidoctor.convert"
  575. asciidoctorj {
  576. version = '1.5.5'
  577. }
  578. configurations {
  579. docs
  580. }
  581. dependencies {
  582. docs "io.spring.docresources:spring-doc-resources:${docResourcesVersion}@zip"
  583. }
  584. task prepareAsciidocBuild(type: Sync) {
  585. dependsOn configurations.docs
  586. // copy doc resources
  587. from {
  588. configurations.docs.collect { zipTree(it) }
  589. }
  590. // and doc sources
  591. from "spring-batch-docs/asciidoc/"
  592. // to a build directory of your choice
  593. into "$buildDir/asciidoc/assemble"
  594. }
  595. task('makePDF', type: org.asciidoctor.gradle.AsciidoctorTask){
  596. dependsOn prepareAsciidocBuild
  597. backends 'pdf'
  598. sourceDir "$buildDir/asciidoc/assemble"
  599. sources {
  600. include 'index-single.adoc'
  601. }
  602. options doctype: 'book', eruby: 'erubis'
  603. logDocuments = true
  604. attributes 'icons': 'font',
  605. 'sectanchors': '',
  606. 'sectnums': '',
  607. 'toc': '',
  608. 'source-highlighter' : 'coderay',
  609. revnumber: project.version
  610. }
  611. asciidoctor {
  612. dependsOn makePDF
  613. backends 'html5'
  614. sourceDir "$buildDir/asciidoc/assemble"
  615. resources {
  616. from(sourceDir) {
  617. include 'images/*', 'css/**', 'js/**'
  618. }
  619. }
  620. options doctype: 'book', eruby: 'erubis'
  621. logDocuments = true
  622. attributes 'docinfo': 'shared',
  623. // use provided stylesheet
  624. stylesdir: "css/",
  625. stylesheet: 'spring.css',
  626. 'linkcss': true,
  627. 'icons': 'font',
  628. 'sectanchors': '',
  629. // use provided highlighter
  630. 'source-highlighter=highlight.js',
  631. 'highlightjsdir=js/highlight',
  632. 'highlightjs-theme=github',
  633. 'idprefix': '',
  634. 'idseparator': '-',
  635. 'spring-version': project.version,
  636. 'allow-uri-read': '',
  637. revnumber: project.version
  638. }
  639. apply plugin: 'org.sonarqube'
  640. sonarqube {
  641. properties {
  642. property "sonar.projectName", "Spring Batch"
  643. property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
  644. property "sonar.links.homepage", linkHomepage
  645. property "sonar.links.ci", linkCi
  646. property "sonar.links.issue", linkIssue
  647. property "sonar.links.scm", linkScmUrl
  648. property "sonar.links.scm_dev", linkScmDevConnection
  649. property "sonar.java.coveragePlugin", "jacoco"
  650. }
  651. }
  652. task api(type: Javadoc) {
  653. group = 'Documentation'
  654. description = 'Generates aggregated Javadoc API documentation.'
  655. title = "Spring Batch ${version} API"
  656. options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
  657. options.author = true
  658. options.header = 'Spring Batch'
  659. options.overview = 'src/api/overview.html'
  660. if (JavaVersion.current().isJava8Compatible()) {
  661. options.addStringOption('Xdoclint:none', '-quiet')
  662. }
  663. source subprojects
  664. .findAll { it.name != 'spring-batch-samples' && !it.name.endsWith("-tests") }
  665. .collect { project -> project.sourceSets.main.allJava }
  666. destinationDir = new File(buildDir, "api")
  667. classpath = files(subprojects.collect { project ->
  668. project.sourceSets.main.compileClasspath
  669. })
  670. }
  671. task schemaZip(type: Zip) {
  672. group = 'Distribution'
  673. classifier = 'schema'
  674. description = "Builds -${classifier} archive containing all " +
  675. "XSDs for deployment at static.springframework.org/schema."
  676. subprojects.each { subproject ->
  677. def Properties schemas = new Properties();
  678. def shortName = subproject.name.replaceFirst("${rootProject.name}-", '')
  679. if (subproject.name.endsWith("-core")) {
  680. shortName = ''
  681. }
  682. subproject.sourceSets.main.resources.find {
  683. it.path.endsWith("META-INF${File.separator}spring.schemas")
  684. }?.withInputStream { schemas.load(it) }
  685. for (def key : schemas.keySet()) {
  686. File xsdFile = subproject.sourceSets.main.resources.find {
  687. it.path.replaceAll('\\\\', '/').endsWith(schemas.get(key))
  688. }
  689. assert xsdFile != null
  690. into ("batch/${shortName}") {
  691. from xsdFile.path
  692. }
  693. }
  694. }
  695. }
  696. task docsZip(type: Zip) {
  697. group = 'Distribution'
  698. classifier = 'docs'
  699. description = "Builds -${classifier} archive containing api and reference " +
  700. "for deployment at static.springframework.org/spring-batch/reference."
  701. from('src/dist') {
  702. include 'changelog.txt'
  703. }
  704. from (api) {
  705. into 'api'
  706. }
  707. from (makePDF) {
  708. include "index-single.pdf"
  709. rename 'index-single.pdf', 'spring-batch-reference.pdf'
  710. into 'reference/pdf'
  711. }
  712. from (asciidoctor) {
  713. include "*.html"
  714. include "css/**"
  715. include "js/**"
  716. include "images/**"
  717. into 'reference/html'
  718. }
  719. }
  720. task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
  721. group = 'Distribution'
  722. classifier = 'dist'
  723. description = "Builds -${classifier} archive, containing all jars and docs, " +
  724. "suitable for community download page."
  725. ext.baseDir = "${project.name}-${project.version}";
  726. from('src/dist') {
  727. include 'readme.txt'
  728. include 'license.txt'
  729. include 'notice.txt'
  730. into "${baseDir}"
  731. expand(copyright: new Date().format("yyyy"), version: project.version)
  732. }
  733. from(zipTree(docsZip.archivePath)) {
  734. into "${baseDir}/docs"
  735. }
  736. from(zipTree(schemaZip.archivePath)) {
  737. into "${baseDir}/schema"
  738. }
  739. [project(':spring-batch-core'), project(':spring-batch-infrastructure'), project(':spring-batch-test'), project(':spring-batch-integration')].each { subproject ->
  740. into ("${baseDir}/libs") {
  741. from subproject.jar
  742. from subproject.sourcesJar
  743. from subproject.javadocJar
  744. }
  745. }
  746. }
  747. // Create an optional "with dependencies" distribution.
  748. // Not published by default; only for use when building from source.
  749. task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
  750. group = 'Distribution'
  751. classifier = 'dist-with-deps'
  752. description = "Builds -${classifier} archive, containing everything " +
  753. "in the -${distZip.classifier} archive plus all dependencies."
  754. from zipTree(distZip.archivePath)
  755. gradle.taskGraph.whenReady { taskGraph ->
  756. if (taskGraph.hasTask(":${zipTask.name}")) {
  757. def projectNames = rootProject.subprojects*.name
  758. def artifacts = new HashSet()
  759. subprojects.each { subproject ->
  760. subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
  761. def dependency = artifact.moduleVersion.id
  762. if (!projectNames.contains(dependency.name)) {
  763. artifacts << artifact.file
  764. }
  765. }
  766. }
  767. zipTask.from(artifacts) {
  768. into "${distZip.baseDir}/deps"
  769. }
  770. }
  771. }
  772. }
  773. artifacts {
  774. archives distZip
  775. archives docsZip
  776. archives schemaZip
  777. }
  778. task dist(dependsOn: assemble) {
  779. group = 'Distribution'
  780. description = 'Builds -dist, -docs and -schema distribution archives.'
  781. }
  782. task runTck(dependsOn: subprojects.compileJava) {
  783. configurations {
  784. tck {
  785. transitive = true
  786. }
  787. antcp {
  788. transitive = true
  789. exclude module: 'ant'
  790. }
  791. }
  792. dependencies {
  793. tck project(":spring-batch-core")
  794. tck "commons-pool:commons-pool:$commonsPoolVersion"
  795. tck "javax.batch:javax.batch-api:$javaxBatchApiVersion"
  796. tck "org.springframework:spring-core:$springVersion"
  797. tck "org.springframework:spring-context:$springVersion"
  798. tck "org.springframework:spring-beans:$springVersion"
  799. tck 'commons-logging:commons-logging-api:1.1'
  800. tck "org.springframework:spring-aop:$springVersion"
  801. tck "org.springframework:spring-tx:$springVersion"
  802. tck "org.springframework.retry:spring-retry:$springRetryVersion"
  803. tck "org.hsqldb:hsqldb:$hsqldbVersion"
  804. tck "org.springframework:spring-jdbc:$springVersion"
  805. tck "com.thoughtworks.xstream:xstream:$xstreamVersion"
  806. tck "org.codehaus.jettison:jettison:$jettisonVersion"
  807. tck "org.apache.commons:commons-dbcp2:$commonsDdbcpVersion"
  808. tck "org.apache.derby:derby:$derbyVersion"
  809. antcp "ant-contrib:ant-contrib:1.0b3"
  810. }
  811. doLast {
  812. logger.info('tck dependencies: ' + configurations.tck.asPath)
  813. def tckHome = project.hasProperty('TCK_HOME') ? getProperty('TCK_HOME') : System.getenv("JSR_352_TCK_HOME")
  814. assert tckHome : '''\
  815. tckHome is not set. Please set either the environment variable 'JSR_352_TCK_HOME'
  816. or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/path/to/tck'''
  817. println "Using the JSR 352 TCK at: '$tckHome'"
  818. ant.taskdef resource: "net/sf/antcontrib/antcontrib.properties",
  819. classpath: configurations.antcp.asPath
  820. ant.properties['batch.impl.classes'] = configurations.tck.asPath
  821. ant.ant antfile: "$tckHome/build.xml", target: "run", dir: "$tckHome"
  822. }
  823. }
  824. wrapper {
  825. description = 'Generates gradlew[.bat] scripts'
  826. gradleVersion = '6.3'
  827. }