use of org.eclipse.ceylon.cmr.impl.InvalidArchiveException in project ceylon by eclipse.
the class CeylonEnter method addOutputModuleToClassPath.
public void addOutputModuleToClassPath(Module module) {
RepositoryManager repositoryManager = fileManager.getOutputRepositoryManager();
ArtifactResult artifact = null;
try {
ArtifactContext ctx = new ArtifactContext(null, module.getNameAsString(), module.getVersion(), ArtifactContext.CAR, ArtifactContext.JAR);
artifact = repositoryManager.getArtifactResult(ctx);
} catch (InvalidArchiveException e) {
log.warning("ceylon", "Module car " + e.getPath() + " obtained from repository " + e.getRepository() + " has an invalid SHA1 signature:" + " it will be overwritten but if the problem" + " persists you need to remove it and rebuild the module, since it may be corrupted.");
} catch (Exception e) {
String moduleName = module.getNameAsString();
if (!module.isDefaultModule())
moduleName += "/" + module.getVersion();
log.error("ceylon", "Exception occured while trying to resolve module " + moduleName);
e.printStackTrace();
}
if (artifact == null || JarUtils.isValidJar(artifact.artifact())) {
addModuleToClassPath(module, false, artifact);
} else {
log.warning("ceylon", "Module car " + artifact.artifact() + " obtained from repository " + artifact.repository() + " could not be read:" + " it will be overwritten but if the problem" + " persists you need to remove it and rebuild the module, since it may be corrupted.");
}
}
Aggregations