Reinstate ./repository as a "remote" repository

The grab command downloads the dependencies of one or more Groovy
scripts to ./repository. This commit ensures that those previously
downloaded dependencies can be used by a subsequent invocation of the
run command.

The location and behaviour of the local cache is unaffected by this
change. If the dependencies in ./repository do not exist in the local
cache, Aether will "download" them from ./repository and store them in
the local cache.

Fixes #191
This commit is contained in:
Andy Wilkinson 2014-01-07 09:46:35 +00:00
parent a58e4cbb1f
commit a010de955d

View File

@ -17,6 +17,7 @@
package org.springframework.boot.cli.command;
import java.awt.Desktop;
import java.io.File;
import java.util.List;
import java.util.logging.Level;
@ -35,9 +36,10 @@ import static java.util.Arrays.asList;
/**
* {@link Command} to 'run' a groovy script or scripts.
*
*
* @author Phillip Webb
* @author Dave Syer
* @author Andy Wilkinson
* @see SpringApplicationRunner
*/
public class RunCommand extends OptionParsingCommand {
@ -101,6 +103,8 @@ public class RunCommand extends OptionParsingCommand {
List<RepositoryConfiguration> repositoryConfiguration = RepositoryConfigurationFactory
.createDefaultRepositoryConfiguration();
repositoryConfiguration.add(0, new RepositoryConfiguration("local", new File(
"repository").toURI(), true));
SpringApplicationRunnerConfiguration configuration = new SpringApplicationRunnerConfigurationAdapter(
options, this, repositoryConfiguration);