diff --git a/demos/embedded/src/main/java/org/eclipse/jetty/demos/JettyDemoBase.java b/demos/embedded/src/main/java/org/eclipse/jetty/demos/JettyDemoBase.java index 968e6af4bee..d4bea3bc2c6 100644 --- a/demos/embedded/src/main/java/org/eclipse/jetty/demos/JettyDemoBase.java +++ b/demos/embedded/src/main/java/org/eclipse/jetty/demos/JettyDemoBase.java @@ -87,6 +87,7 @@ public class JettyDemoBase "jetty.version=" + jettyVersion, "jetty.home=" + jettyHome.toString(), "jetty.base=" + jettyBase.toString(), + "maven.local.repo=" + System.getProperty("mavenRepoPath"), "--add-modules=logging-jetty,demo" }; diff --git a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/JettyHomeTester.java b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/JettyHomeTester.java index 2a255f942ad..8cd90b09404 100644 --- a/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/JettyHomeTester.java +++ b/tests/test-distribution/src/main/java/org/eclipse/jetty/tests/distribution/JettyHomeTester.java @@ -61,6 +61,7 @@ import org.eclipse.aether.transport.http.HttpTransporterFactory; import org.eclipse.jetty.toolchain.test.FS; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; import org.eclipse.jetty.util.IO; +import org.eclipse.jetty.util.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -155,10 +156,12 @@ public class JettyHomeTester args = new ArrayList<>(args); - args.add("maven.local.repo=" + config.mavenLocalRepository); - - // we get artifacts from local repo first - args.add("maven.local.repo=" + System.getProperty("mavenRepoPath")); + if (StringUtil.isNotBlank( config.mavenLocalRepository)) { + args.add("maven.local.repo=" + config.mavenLocalRepository); + } else if (StringUtil.isNotBlank(System.getProperty("mavenRepoPath"))){ + // we get artifacts from local repo first + args.add("maven.local.repo=" + System.getProperty("mavenRepoPath")); + } // if this JVM has `maven.repo.uri` defined, make sure to propagate it to child String remoteRepoUri = System.getProperty("maven.repo.uri");