diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle index 8e7b02eb8a..0551df02a2 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.gradle @@ -25,6 +25,8 @@ plugins.withType(EclipsePlugin) { dependencies { antDependencies 'org.apache.ivy:ivy:2.4.0' antDependencies project(path: ':spring-boot-project:spring-boot-tools:spring-boot-antlib') + antDependencies 'org.apache.ant:ant-launcher:1.9.3' + antDependencies 'org.apache.ant:ant:1.9.3' testRepository project(path: ':spring-boot-project:spring-boot-tools:spring-boot-loader', configuration: 'mavenRepository') testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter', configuration: 'mavenRepository') @@ -44,22 +46,18 @@ task syncTestRepository(type: Sync) { } } -ant.importBuild('build.xml') { - 'ant' + it -} -ant.properties['ant-spring-boot.version'] = project.version -ant.properties['projectDir'] = project.layout.projectDirectory - -antresolve { +task antRun(type: JavaExec) { dependsOn syncTestRepository, configurations.antDependencies - doFirst { - ClassLoader antClassLoader = org.apache.tools.ant.Project.class.classLoader - configurations.antDependencies.each { antClassLoader.addURL it.toURI().toURL() } - } + classpath = configurations.antDependencies; + main = 'org.apache.tools.ant.launch.Launcher' + systemProperties = [ + 'ant-spring-boot.version' : version, + 'projectDir': project.layout.projectDirectory + ] } task test(type: Test) { - dependsOn antbuild + dependsOn antRun testClassesDirs = sourceSets.test.output.classesDirs classpath = sourceSets.test.runtimeClasspath } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml index 1cc4fcae34..df45ef2f87 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-ant/build.xml @@ -29,7 +29,7 @@ - +