Browse Source

SEC-2622: Set classesDirectory if exists for integrationTomcatRun

Rob Winch 11 years ago
parent
commit
ec1c5b0e78
1 changed files with 4 additions and 2 deletions
  1. 4 2
      gradle/tomcat.gradle

+ 4 - 2
gradle/tomcat.gradle

@@ -21,14 +21,16 @@ dependencies {
 task integrationTomcatRun(type: org.gradle.api.plugins.tomcat.tasks.TomcatRun) {
     onlyIf { !sourceSets.integrationTest.allSource.empty }
     buildscriptClasspath = tomcatRun.buildscriptClasspath
-    classesDirectory = project.sourceSets.main.output.classesDir
     contextPath = tomcatRun.contextPath
     daemon = true
     tomcatClasspath = tomcatRun.tomcatClasspath
     webAppClasspath = tomcatRun.webAppClasspath
     webAppSourceDirectory = tomcatRun.webAppSourceDirectory
     doFirst {
-
+        def mainOutputDir = project.sourceSets.main.output.classesDir
+        if(mainOutputDir) {
+            classesDirectory = mainOutputDir
+        }
         // delay reserving ports to ensure they are still available
         def ports = reservePorts(3)
         httpPort = ports[0]