diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/pom.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/pom.xml index 44e3340a34..386638d460 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/pom.xml +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/pom.xml @@ -54,6 +54,7 @@ ${maven.home} + ${repository} diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index cb439df345..1753c6e161 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -25,6 +25,7 @@ import java.io.IOException; import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Properties; import java.util.jar.JarOutputStream; import java.util.zip.ZipEntry; @@ -37,6 +38,7 @@ import org.apache.maven.shared.invoker.MavenInvocationException; import org.junit.rules.TemporaryFolder; import org.springframework.util.FileCopyUtils; +import org.springframework.util.StringUtils; import static org.assertj.core.api.Assertions.assertThat; @@ -128,6 +130,12 @@ class ApplicationBuilder { InvocationRequest invocation = new DefaultInvocationRequest(); invocation.setBaseDirectory(appFolder); invocation.setGoals(Collections.singletonList("package")); + String repository = System.getProperty("repository"); + if (StringUtils.hasText(repository) && !repository.equals("${repository}")) { + Properties properties = new Properties(); + properties.put("repository", repository); + invocation.setProperties(properties); + } InvocationResult execute = new DefaultInvoker().execute(invocation); assertThat(execute.getExitCode()).isEqualTo(0); } diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/resources/pom-template.xml b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/resources/pom-template.xml index b9f0411a4d..6d8206dbd6 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/resources/pom-template.xml +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-integration-tests-embedded-servlet-container/src/test/resources/pom-template.xml @@ -61,4 +61,32 @@ + + + repository + + + repository + + + + + repository + ${repository} + + true + + + + + + repository + ${repository} + + true + + + + +