diff --git a/spring-boot-samples/spring-boot-sample-custom-layout/pom.xml b/spring-boot-samples/spring-boot-sample-custom-layout/pom.xml
index 17e45a2463b..7b9cbfbe00f 100644
--- a/spring-boot-samples/spring-boot-sample-custom-layout/pom.xml
+++ b/spring-boot-samples/spring-boot-sample-custom-layout/pom.xml
@@ -65,32 +65,6 @@
org.apache.maven.plugins
maven-failsafe-plugin
-
- org.apache.maven.plugins
- maven-dependency-plugin
-
-
- copy-effective-pom
- generate-test-resources
-
- copy
-
-
-
-
- org.springframework.boot
- spring-boot-dependencies
- ${project.version}
- effective-pom
- true
- ${project.build.directory}
- dependencies-pom.xml
-
-
-
-
-
-
diff --git a/spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradeIT.java b/spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradleIT.java
similarity index 87%
rename from spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradeIT.java
rename to spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradleIT.java
index 5a132fa00e4..b488064a21e 100644
--- a/spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradeIT.java
+++ b/spring-boot-samples/spring-boot-sample-custom-layout/src/test/java/sample/layout/GradleIT.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2016 the original author or authors.
+ * Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,7 +31,7 @@ import org.xml.sax.InputSource;
import org.springframework.util.FileCopyUtils;
-public class GradeIT {
+public class GradleIT {
@Test
public void sampleDefault() throws Exception {
@@ -60,7 +60,8 @@ public class GradeIT {
((DefaultGradleConnector) gradleConnector).embedded(true);
ProjectConnection project = gradleConnector.forProjectDirectory(projectDirectory)
.connect();
- project.newBuild().forTasks("clean", "build")
+ project.newBuild().forTasks("clean", "build").setStandardOutput(System.out)
+ .setStandardError(System.err)
.withArguments("-PbootVersion=" + getBootVersion()).run();
Verify.verify(
new File("target/gradleit/" + name + "/build/libs/" + name + ".jar"),
@@ -69,7 +70,8 @@ public class GradeIT {
public static String getBootVersion() {
return evaluateExpression(
- "/*[local-name()='project']/*[local-name()='version']" + "/text()");
+ "/*[local-name()='project']/*[local-name()='parent']/*[local-name()='version']"
+ + "/text()");
}
private static String evaluateExpression(String expression) {
@@ -77,8 +79,7 @@ public class GradeIT {
XPathFactory xPathFactory = XPathFactory.newInstance();
XPath xpath = xPathFactory.newXPath();
XPathExpression expr = xpath.compile(expression);
- String version = expr.evaluate(
- new InputSource(new FileReader("target/dependencies-pom.xml")));
+ String version = expr.evaluate(new InputSource(new FileReader("pom.xml")));
return version;
}
catch (Exception ex) {