diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle index 21413e3f9f2..53488ff4fe8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/build.gradle @@ -8,35 +8,13 @@ repositories { mavenCentral() } -def addDependency(configurationName, dependency) { - def coordinates = [ - 'group': dependency.groupId.text(), - 'name': dependency.artifactId.text(), - 'version': dependency.version.text() - ] - dependencies { - add configurationName, coordinates - } -} - -def effectivePomFile = file('target/effective-pom.xml') -if (effectivePomFile.file) { - def pom = new XmlSlurper().parseText(file('target/effective-pom.xml').text) - pom.dependencies.dependency.each { dependency -> - def scope = dependency.scope.text() - if (scope == 'compile') { - addDependency scope, dependency - } - else if (scope == 'test') { - addDependency 'testCompile', dependency - } - } -} - dependencies { compile localGroovy() compile gradleApi() + compile fileTree(dir: 'target/dependencies/compile', include: '*.jar') testCompile gradleTestKit() + testCompile 'org.apache.commons:commons-compress:1.13' + testCompile fileTree(dir: 'target/dependencies/test', include: '*.jar') } jar { diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java index e2ae48367a1..351e201b5c0 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/testkit/GradleBuild.java @@ -196,7 +196,7 @@ public class GradleBuild implements TestRule { XPathFactory xPathFactory = XPathFactory.newInstance(); XPath xpath = xPathFactory.newXPath(); XPathExpression expr = xpath.compile(expression); - String version = expr.evaluate(new InputSource(new FileReader("pom.xml"))); + String version = expr.evaluate(new InputSource(new FileReader(".flattened-pom.xml"))); return version; } catch (Exception ex) {