diff --git a/spring-boot-cli/pom.xml b/spring-boot-cli/pom.xml
index 4e947595d4e..e3e129416b6 100644
--- a/spring-boot-cli/pom.xml
+++ b/spring-boot-cli/pom.xml
@@ -26,29 +26,13 @@
-
-
-
- org.springframework.boot
- spring-boot-starter-parent
- ${project.version}
- pom
- import
-
-
- org.codehaus.groovy
- groovy-xml
- ${groovy.version}
-
-
- org.projectreactor
- reactor-core
- ${reactor.version}
-
-
-
+
+ ${project.groupId}
+ spring-boot-dependency-tools
+ ${project.version}
+
jline
jline
@@ -131,21 +115,6 @@
-
-
- src/main/resources
- true
-
- **/*.vpp
-
-
-
- src/main/groovy
-
-
- ${project.build.directory}/generated-resources
-
-
maven-failsafe-plugin
@@ -251,11 +220,6 @@
-
- foundrylogic.vpp
- vpp
- 2.2.1
-
org.apache.ant
ant-nodeps
@@ -268,24 +232,6 @@
-
- generate-cli-properties
- generate-resources
-
-
-
-
-
-
-
-
-
- run
-
-
homebrew
package
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java
index 62321fe0d13..2061f5d5208 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/GroovyCompiler.java
@@ -91,7 +91,7 @@ public class GroovyCompiler {
this.configuration = configuration;
this.loader = createLoader(configuration);
- this.coordinatesResolver = new PropertiesArtifactCoordinatesResolver(this.loader);
+ this.coordinatesResolver = new ManagedDependenciesArtifactCoordinatesResolver();
AetherGrapeEngine grapeEngine = AetherGrapeEngineFactory.create(this.loader,
configuration.getRepositoryConfiguration());
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ManagedDependenciesArtifactCoordinatesResolver.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ManagedDependenciesArtifactCoordinatesResolver.java
new file mode 100644
index 00000000000..b60cce6f4b5
--- /dev/null
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/ManagedDependenciesArtifactCoordinatesResolver.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2012-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.boot.cli.compiler;
+
+import org.springframework.boot.dependency.tools.Dependency;
+import org.springframework.boot.dependency.tools.ManagedDependencies;
+
+/**
+ * {@link ArtifactCoordinatesResolver} backed by {@link ManagedDependencies}.
+ *
+ * @author Phillip Webb
+ */
+public class ManagedDependenciesArtifactCoordinatesResolver implements
+ ArtifactCoordinatesResolver {
+
+ private final ManagedDependencies dependencies;
+
+ public ManagedDependenciesArtifactCoordinatesResolver() {
+ this(ManagedDependencies.get());
+ }
+
+ ManagedDependenciesArtifactCoordinatesResolver(ManagedDependencies dependencies) {
+ this.dependencies = dependencies;
+ }
+
+ @Override
+ public String getGroupId(String artifactId) {
+ Dependency dependency = find(artifactId);
+ return (dependency == null ? null : dependency.getGroupId());
+ }
+
+ @Override
+ public String getVersion(String artifactId) {
+ Dependency dependency = find(artifactId);
+ return (dependency == null ? null : dependency.getVersion());
+ }
+
+ private Dependency find(String artifactId) {
+ if (artifactId != null) {
+ if (artifactId.startsWith("spring-boot")) {
+ return new Dependency("org.springframework.boot", artifactId,
+ this.dependencies.getVersion());
+ }
+ return this.dependencies.find(artifactId);
+ }
+ return null;
+ }
+}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/PropertiesArtifactCoordinatesResolver.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/PropertiesArtifactCoordinatesResolver.java
deleted file mode 100644
index 709d6e54d32..00000000000
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/PropertiesArtifactCoordinatesResolver.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright 2012-2013 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.cli.compiler;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import org.springframework.util.Assert;
-
-/**
- * {@link ArtifactCoordinatesResolver} backed by a properties file.
- *
- * @author Andy Wilkinson
- */
-public final class PropertiesArtifactCoordinatesResolver implements
- ArtifactCoordinatesResolver {
-
- private final ClassLoader loader;
-
- private Properties properties = null;
-
- public PropertiesArtifactCoordinatesResolver(ClassLoader loader) {
- this.loader = loader;
- }
-
- @Override
- public String getGroupId(String artifactId) {
- return getProperty(artifactId + ".groupId");
- }
-
- @Override
- public String getVersion(String artifactId) {
- return getProperty(artifactId + ".version");
- }
-
- private String getProperty(String name) {
- if (this.properties == null) {
- this.properties = loadProperties();
- }
- String property = this.properties.getProperty(name);
- return property;
- }
-
- private Properties loadProperties() {
- Properties properties = new Properties();
- InputStream inputStream = this.loader
- .getResourceAsStream("META-INF/springcli.properties");
- Assert.state(inputStream != null, "Unable to load springcli properties");
- try {
- properties.load(inputStream);
- return properties;
- }
- catch (IOException ex) {
- throw new IllegalStateException("Unable to load springcli properties", ex);
- }
- }
-
-}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java
index 5fac11b1fac..278f93a71d2 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/AetherGrapeEngineFactory.java
@@ -63,7 +63,7 @@ public abstract class AetherGrapeEngineFactory {
new DefaultRepositorySystemSessionAutoConfiguration().apply(
repositorySystemSession, repositorySystem);
- List managedDependencies = new PropertiesManagedDependenciesFactory()
+ List managedDependencies = new ManagedDependenciesFactory()
.getManagedDependencies();
return new AetherGrapeEngine(classLoader, repositorySystem,
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
index 8d683db0d2f..546e737747c 100644
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
+++ b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/ManagedDependenciesFactory.java
@@ -16,21 +16,48 @@
package org.springframework.boot.cli.compiler.grape;
+import java.util.ArrayList;
import java.util.List;
+import org.eclipse.aether.artifact.Artifact;
+import org.eclipse.aether.artifact.DefaultArtifact;
import org.eclipse.aether.graph.Dependency;
+import org.eclipse.aether.util.artifact.JavaScopes;
+import org.springframework.boot.dependency.tools.ManagedDependencies;
/**
- * An abstraction for accessing the managed dependencies that should be used to influence
- * the outcome of dependency resolution performed by Aether.
+ * Factory to create Maven {@link Dependency} objects from Boot
+ * {@link ManagedDependencies}.
*
- * @author Andy Wilkinson
+ * @author Phillip Webb
*/
-public interface ManagedDependenciesFactory {
+public class ManagedDependenciesFactory {
+
+ private final ManagedDependencies dependencies;
+
+ ManagedDependenciesFactory() {
+ this(ManagedDependencies.get());
+ }
+
+ ManagedDependenciesFactory(ManagedDependencies dependencies) {
+ this.dependencies = dependencies;
+ }
/**
- * Returns the managed dependencies.
+ * Return a list of the managed dependencies.
*/
- List getManagedDependencies();
+ public List getManagedDependencies() {
+ List result = new ArrayList();
+ for (org.springframework.boot.dependency.tools.Dependency dependency : this.dependencies) {
+ Artifact artifact = asArtifact(dependency);
+ result.add(new Dependency(artifact, JavaScopes.COMPILE));
+ }
+ return result;
+ }
+ private Artifact asArtifact(
+ org.springframework.boot.dependency.tools.Dependency dependency) {
+ return new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(),
+ "jar", dependency.getVersion());
+ }
}
diff --git a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/PropertiesManagedDependenciesFactory.java b/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/PropertiesManagedDependenciesFactory.java
deleted file mode 100644
index 3cea373c1c1..00000000000
--- a/spring-boot-cli/src/main/java/org/springframework/boot/cli/compiler/grape/PropertiesManagedDependenciesFactory.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright 2012-2014 the original author or authors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.springframework.boot.cli.compiler.grape;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-import java.util.Properties;
-
-import org.eclipse.aether.artifact.Artifact;
-import org.eclipse.aether.artifact.DefaultArtifact;
-import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.util.artifact.JavaScopes;
-import org.springframework.util.Assert;
-
-/**
- * A {@link ManagedDependenciesFactory} that uses a properties file to configure the list
- * of managed dependencies that it returns.
- *
- * @author Andy Wilkinson
- */
-class PropertiesManagedDependenciesFactory implements ManagedDependenciesFactory {
-
- private static final String PROPERTY_SUFFIX_GROUP_ID = ".groupId";
-
- private static final String PROPERTY_SUFFIX_VERSION = ".version";
-
- private final List managedDependencies;
-
- public PropertiesManagedDependenciesFactory() {
- Properties properties = loadProperties();
- this.managedDependencies = getManagedDependencies(properties);
- }
-
- private static Properties loadProperties() {
- Properties properties = new Properties();
- InputStream inputStream = PropertiesManagedDependenciesFactory.class
- .getClassLoader().getResourceAsStream("META-INF/springcli.properties");
- Assert.state(inputStream != null, "Unable to load springcli properties");
- try {
- properties.load(inputStream);
- return properties;
- }
- catch (IOException ex) {
- throw new IllegalStateException("Unable to load springcli properties", ex);
- }
- }
-
- private static List getManagedDependencies(Properties properties) {
- List dependencies = new ArrayList();
-
- for (Entry