Merge branch '1.0.x'

This commit is contained in:
Andy Wilkinson
2014-05-30 15:33:47 +01:00
2 changed files with 68 additions and 5 deletions

View File

@@ -49,7 +49,7 @@ import org.springframework.boot.cli.compiler.DependencyResolutionContext;
* A {@link GrapeEngine} implementation that uses <a
* href="http://eclipse.org/aether">Aether</a>, the dependency resolution system used by
* Maven.
*
*
* @author Andy Wilkinson
* @author Phillip Webb
*/
@@ -171,13 +171,27 @@ public class AetherGrapeEngine implements GrapeEngine {
String group = (String) dependencyMap.get("group");
String module = (String) dependencyMap.get("module");
String version = (String) dependencyMap.get("version");
String classifier = (String) dependencyMap.get("classifier");
String type = determineType(dependencyMap);
return new DefaultArtifact(group, module, classifier, type, version);
}
private String determineType(Map<?, ?> dependencyMap) {
String type = (String) dependencyMap.get("type");
String ext = (String) dependencyMap.get("ext");
if (type == null) {
type = "jar";
type = ext;
if (type == null) {
type = "jar";
}
}
return new DefaultArtifact(group, module, type, version);
else if (ext != null && !type.equals(ext)) {
throw new IllegalArgumentException(
"If both type and ext are specified they must have the same value");
}
return type;
}
private boolean isTransitive(Map<?, ?> dependencyMap) {