@Test public void shouldLoadFromEnvWithVersionResolving() throws LifecycleExecutionException { EnvironmentSettingDependencyLoader loader = new EnvironmentSettingDependencyLoader() { @Override protected String getEnvSetting(String name) { return "org.foo:foo-artifact:@foo.version@,org.bar:bar-artifact:@bar.version@"; } }; properties.put("foo.version", "1.0.0"); properties.put("bar.version", "1.5.0"); List<Dependency> dependencyList = loader.load(properties, logger); TestHelper.verifyDependencies(dependencyList); }
@Override public List<Dependency> load(Properties properties, Logger logger) throws LifecycleExecutionException { List<Dependency> dependencyList = new ArrayList<>(); String coordinates = getEnvSetting(ExtensionSettings.DEPENDENCIES_SETTING_ENV); if (coordinates.length() > 0) { for (String coordinate : coordinates.split(",")) { dependencyList.add(build(coordinate, properties, logger)); } if (!dependencyList.isEmpty()) { logger.info(String.format("Add %s dependencies found in environment variables", dependencyList.size())); } } return dependencyList; }
EnvironmentSettingDependencyLoader implements DependencyLoader { @Override public List<Dependency> load(Properties properties, Logger logger) throws LifecycleExecutionException { List<Dependency> dependencyList = new ArrayList<>(); String coordinates = getEnvSetting(ExtensionSettings.DEPENDENCIES_SETTING_ENV); if (coordinates.length() > 0) { for (String coordinate : coordinates.split(",")) { dependencyList.add(build(coordinate, properties, logger)); } if (!dependencyList.isEmpty()) { logger.info(String.format("Add %s dependencies found in environment variables", dependencyList.size())); } } return dependencyList; } }
EnvironmentSettingDependencyLoader implements DependencyLoader { @Override public List<Dependency> load(Properties properties, Logger logger) throws LifecycleExecutionException { List<Dependency> dependencyList = new ArrayList<>(); String coordinates = getEnvSetting(ExtensionSettings.DEPENDENCIES_SETTING_ENV); if (coordinates.length() > 0) { for (String coordinate : coordinates.split(",")) { dependencyList.add(build(coordinate, properties, logger)); } if (!dependencyList.isEmpty()) { logger.info(String.format("Add %s dependencies found in environment variables", dependencyList.size())); } } return dependencyList; }  }
EnvironmentSettingDependencyLoader implements DependencyLoader { @Override public List<Dependency> load(Properties properties, Logger logger) throws LifecycleExecutionException { List<Dependency> dependencyList = new ArrayList<>(); String coordinates = getEnvSetting(ExtensionSettings.DEPENDENCIES_SETTING_ENV); if (coordinates.length() > 0) { for (String coordinate : coordinates.split(",")) { dependencyList.add(build(coordinate, properties, logger)); } if (!dependencyList.isEmpty()) { logger.info(String.format("Add %s dependencies found in environment variables", dependencyList.size())); } } return dependencyList; }  @Override List<Dependency> load(Properties properties, Logger logger); }
EnvironmentSettingDependencyLoader implements DependencyLoader { @Override public List<Dependency> load(Properties properties, Logger logger) throws LifecycleExecutionException { List<Dependency> dependencyList = new ArrayList<>(); String coordinates = getEnvSetting(ExtensionSettings.DEPENDENCIES_SETTING_ENV); if (coordinates.length() > 0) { for (String coordinate : coordinates.split(",")) { dependencyList.add(build(coordinate, properties, logger)); } if (!dependencyList.isEmpty()) { logger.info(String.format("Add %s dependencies found in environment variables", dependencyList.size())); } } return dependencyList; }  @Override List<Dependency> load(Properties properties, Logger logger);  }