}
} else {
versionedModule = module.latest();
}
VersionedDependencyId id = versionedModule.getId();
String v = version!=null ? version : id.getVersion();
List<String> extensionAdjustments = Arrays.asList(extensions);
if( !extensionAdjustments.isEmpty() ) {
List<String> enabled = new ArrayList<String>(versionedModule.getDefaultExtensions());
for (String adjustment : extensionAdjustments) {
if( adjustment.startsWith("+") ) {
String name = adjustment.substring(1);
enabled.add(name);
} else if( adjustment.startsWith("-") ) {
String name = adjustment.substring(1);
enabled.remove(name);
} else {
throw new IllegalArgumentException("Expected extension argument '"+adjustment+"' to be prefixed with '+' or '-'");
}
}
versionedModule.setEnabledExtensions(enabled);
if( !enabled.isEmpty() ) {
println("Enabling extensions: "+join(enabled, ", "));
}
}
//
String url = "fab:mvn:"+id.getGroupId()+"/"+id.getArtifactId()+"/"+v+"/"+id.getExtension()+
(id.getClassifier()==null ? "" : "/"+id.getClassifier());
println("Installing: "+url);
Bundle bundle = install(url);
if( bundle!=null ) {