diff --git a/build.gradle b/build.gradle index 22fc40c619..d6a18f487f 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { dependencies { classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7") classpath("io.spring.gradle:spring-io-plugin:0.0.4.RELEASE") - classpath("org.gradle.api.plugins:gradle-tomcat-plugin:1.2.5") + classpath("com.bmuschko:gradle-tomcat-plugin:2.2.4") classpath('me.champeau.gradle:gradle-javadoc-hotfix-plugin:0.1') classpath('org.asciidoctor:asciidoctor-gradle-plugin:1.5.1') classpath("io.spring.gradle:docbook-reference-plugin:0.3.1") diff --git a/gradle/tomcat.gradle b/gradle/tomcat.gradle index 0ad83472b6..767eb9083b 100644 --- a/gradle/tomcat.gradle +++ b/gradle/tomcat.gradle @@ -3,26 +3,22 @@ buildscript { maven { url "https://repo.spring.io/plugins-release" } } dependencies { - classpath("org.gradle.api.plugins:gradle-tomcat-plugin:1.2.5") + classpath("com.bmuschko:gradle-tomcat-plugin:2.2.4") } } -apply plugin: 'tomcat' +apply plugin: 'com.bmuschko.tomcat' dependencies { def tomcatVersion = '7.0.54' tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}", - "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}", - "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}" - tomcat("org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}") { - exclude group: 'org.eclipse.jdt.core.compiler', module: 'ecj' - } + "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-websocket:${tomcatVersion}", + "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}" } -task integrationTomcatRun(type: org.gradle.api.plugins.tomcat.tasks.TomcatRun) { +task integrationTomcatRun(type: com.bmuschko.gradle.tomcat.tasks.TomcatRun) { onlyIf { !sourceSets.integrationTest.allSource.empty } - buildscriptClasspath = tomcatRun.buildscriptClasspath - contextPath = tomcatRun.contextPath daemon = true tomcatClasspath = tomcatRun.tomcatClasspath webAppClasspath = tomcatRun.webAppClasspath @@ -32,6 +28,7 @@ task integrationTomcatRun(type: org.gradle.api.plugins.tomcat.tasks.TomcatRun) { if(mainOutputDir) { classesDirectory = mainOutputDir } + contextPath = tomcatRun.contextPath // delay reserving ports to ensure they are still available def ports = reservePorts(3) httpPort = ports[0] @@ -40,7 +37,7 @@ task integrationTomcatRun(type: org.gradle.api.plugins.tomcat.tasks.TomcatRun) { } } -task integrationTomcatStop(type: org.gradle.api.plugins.tomcat.tasks.TomcatStop) { +task integrationTomcatStop(type: com.bmuschko.gradle.tomcat.tasks.TomcatStop) { onlyIf { !sourceSets.integrationTest.allSource.empty } doFirst { stopPort = integrationTomcatRun.stopPort