diff --git a/spring-cloud-stream-module-launcher/src/main/java/org/springframework/cloud/stream/module/launcher/ModuleLauncher.java b/spring-cloud-stream-module-launcher/src/main/java/org/springframework/cloud/stream/module/launcher/ModuleLauncher.java index 446c5b006..97cc24bef 100644 --- a/spring-cloud-stream-module-launcher/src/main/java/org/springframework/cloud/stream/module/launcher/ModuleLauncher.java +++ b/spring-cloud-stream-module-launcher/src/main/java/org/springframework/cloud/stream/module/launcher/ModuleLauncher.java @@ -19,18 +19,22 @@ package org.springframework.cloud.stream.module.launcher; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.concurrent.Executor; import java.util.concurrent.Executors; import org.springframework.boot.loader.ModuleJarLauncher; import org.springframework.boot.loader.archive.JarFileArchive; +import org.springframework.cloud.stream.module.resolver.AetherModuleResolver; +import org.springframework.cloud.stream.module.resolver.ModuleResolver; +import org.springframework.core.io.Resource; +import org.springframework.util.Assert; /** - * Bootstrap for launching one or more modules. The module path(s), relative to the module home, must be provided via - * the "modules" system property or "MODULES" environment variable as a comma-delimited list. The module home directory - * itself may be provided via the "module.home" system property or "MODULE_HOME" environment variable. The default - * module home directory is: /opt/spring/modules + * Bootstrap for launching one or more modules. The module coordinates (as 'groupId:artifactId:version') must be + * provided via the "modules" system property or "MODULES" environment variable as a comma-delimited list. *
* To pass args to a module, prefix with the module name and a dot. The arg name will be de-qualified and passed along.
* For example: --foo.bar=123 becomes --bar=123 and is only passed to the 'foo' module.
@@ -40,12 +44,16 @@ import org.springframework.boot.loader.archive.JarFileArchive;
*/
public class ModuleLauncher {
- private static final String DEFAULT_MODULE_HOME = "/opt/spring/modules";
+ private static final String LOCAL_REPO = "/opt/spring/modules";
- private final File moduleHome;
+ private final ModuleResolver moduleResolver;
- public ModuleLauncher(File moduleHome) {
- this.moduleHome = moduleHome;
+ public ModuleLauncher() {
+ this(Collections.singletonMap("spring-cloud-stream-modules", "http://repo.spring.io/spring-cloud-stream-modules"));
+ }
+
+ public ModuleLauncher(Map