javaprojects.gradle 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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.9'
  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. configurations {
  14. // Configuration which is ONLY used for compileJava and will not be inherited by any others
  15. // Revisit post Gradle 1.0
  16. compileOnly
  17. // Used to identify deps which should be marked as "provided" in maven poms
  18. provided
  19. testCompile.extendsFrom provided
  20. compile.transitive = false
  21. testCompile.transitive = false
  22. }
  23. dependencies {
  24. compileOnly 'commons-logging:commons-logging:1.1.1'
  25. compile ("org.springframework:spring-core:$springVersion") {
  26. exclude(group: 'commons-logging', module: 'commons-logging')
  27. }
  28. testCompile 'junit:junit:4.7',
  29. 'org.mockito:mockito-core:1.8.5',
  30. "org.springframework:spring-test:$springVersion"
  31. // Use slf4j/logback for logging
  32. testRuntime "org.slf4j:jcl-over-slf4j:$slf4jVersion",
  33. "ch.qos.logback:logback-classic:$logbackVersion"
  34. }
  35. [configurations.runtime, configurations.default]*.exclude(module: 'commons-logging')
  36. sourceSets.main.compileClasspath += configurations.compileOnly
  37. sourceSets.main.compileClasspath += configurations.provided
  38. [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
  39. test {
  40. jvmArgs = ['-ea', '-Xmx500m']
  41. maxParallelForks = guessMaxForks()
  42. testReport = false
  43. }
  44. def guessMaxForks() {
  45. int processors = Runtime.runtime.availableProcessors()
  46. return Math.max(2, (int) (processors / 2))
  47. }