From a010de955de80a46cbb0adb1f91f36c0c84381cc Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 7 Jan 2014 09:46:35 +0000 Subject: [PATCH] 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 --- .../org/springframework/boot/cli/command/RunCommand.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java index 3dab61b0c8..fb11f1fba1 100644 --- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java +++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/command/RunCommand.java @@ -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 = RepositoryConfigurationFactory .createDefaultRepositoryConfiguration(); + repositoryConfiguration.add(0, new RepositoryConfiguration("local", new File( + "repository").toURI(), true)); SpringApplicationRunnerConfiguration configuration = new SpringApplicationRunnerConfigurationAdapter( options, this, repositoryConfiguration);