|
|
@ -25,6 +25,7 @@ import java.io.IOException;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import java.util.Properties;
|
|
|
|
import java.util.jar.JarOutputStream;
|
|
|
|
import java.util.jar.JarOutputStream;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
|
|
|
|
|
|
|
@ -37,6 +38,7 @@ import org.apache.maven.shared.invoker.MavenInvocationException;
|
|
|
|
import org.junit.rules.TemporaryFolder;
|
|
|
|
import org.junit.rules.TemporaryFolder;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
import org.springframework.util.FileCopyUtils;
|
|
|
|
|
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
|
|
|
|
|
|
@ -128,6 +130,12 @@ class ApplicationBuilder {
|
|
|
|
InvocationRequest invocation = new DefaultInvocationRequest();
|
|
|
|
InvocationRequest invocation = new DefaultInvocationRequest();
|
|
|
|
invocation.setBaseDirectory(appFolder);
|
|
|
|
invocation.setBaseDirectory(appFolder);
|
|
|
|
invocation.setGoals(Collections.singletonList("package"));
|
|
|
|
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);
|
|
|
|
InvocationResult execute = new DefaultInvoker().execute(invocation);
|
|
|
|
assertThat(execute.getExitCode()).isEqualTo(0);
|
|
|
|
assertThat(execute.getExitCode()).isEqualTo(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|