javaprojects.gradle 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. apply plugin: 'java'
  2. apply plugin: 'eclipse'
  3. springVersion = '3.0.5.RELEASE'
  4. springLdapVersion = '1.3.0.RELEASE'
  5. ehcacheVersion = '1.6.2'
  6. aspectjVersion = '1.6.10'
  7. apacheDsVersion = '1.5.5'
  8. jstlVersion = '1.2'
  9. jettyVersion = '6.1.22'
  10. hsqlVersion = '1.8.0.10'
  11. slf4jVersion = '1.6.1'
  12. logbackVersion = '0.9.24'
  13. bundlorProperties = [
  14. version: version,
  15. secRange: "[$version, 3.2.0)",
  16. springRange: "[$springVersion, 3.2.0)",
  17. aspectjRange: '[1.6.0, 1.7.0)',
  18. casRange: '[3.1.1, 3.2.0)',
  19. cloggingRange: '[1.0.4, 2.0.0)',
  20. ehcacheRange: '[1.4.1, 2.0.0)',
  21. openid4javaRange: '[0.9.5, 1.0.0)',
  22. springLdapRange: '[1.3.0,1.4.0)',
  23. apacheDSRange: '[1.5.5, 1.6)',
  24. apacheDSSharedRange: '[0.9.15, 1.0)',
  25. ldapSdkRange: '[4.1, 5.0)',
  26. aopAllianceRange: '[1.0.0, 2.0.0)'
  27. ]
  28. configurations {
  29. // Configuration which is ONLY used for compileJava and will not be inherited by any others
  30. // Revisit post Gradle 1.0
  31. compileOnly
  32. // Used to identify deps which should be marked as "provided" in maven poms
  33. provided
  34. testCompile.extendsFrom provided
  35. compile.transitive = false
  36. testCompile.transitive = false
  37. }
  38. dependencies {
  39. compileOnly 'commons-logging:commons-logging:1.1.1'
  40. compile ("org.springframework:spring-core:$springVersion") {
  41. exclude(group: 'commons-logging', module: 'commons-logging')
  42. }
  43. testCompile 'junit:junit:4.7',
  44. 'org.mockito:mockito-core:1.8.5',
  45. "org.springframework:spring-test:$springVersion"
  46. // Use slf4j/logback for logging
  47. testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
  48. "ch.qos.logback:logback-classic:$logbackVersion"
  49. }
  50. [configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
  51. sourceSets.main.compileClasspath += configurations.compileOnly
  52. sourceSets.main.compileClasspath += configurations.provided
  53. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  54. test {
  55. jvmArgs = ['-ea', '-Xmx500m']
  56. maxParallelForks = guessMaxForks()
  57. testReport = false
  58. }
  59. def guessMaxForks() {
  60. int processors = Runtime.runtime.availableProcessors()
  61. return Math.max(2, (int) (processors / 2))
  62. }