use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class MirrorStandaloneTest method testIgnoreErrorShouldNotThrowException.
@Test
public void testIgnoreErrorShouldNotThrowException() throws FacadeException {
MirrorOptions mirrorOptions = new MirrorOptions();
mirrorOptions.setIgnoreErrors(true);
subject.mirrorStandalone(sourceRepos("invalid/wrong_checksum"), destinationRepo, Collections.singletonList(new IUDescription("jarsigning", "0.0.1.201109191414")), mirrorOptions, targetFolder);
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class MirrorApplicationServiceImpl method mirrorStandalone.
@Override
public void mirrorStandalone(RepositoryReferences sources, DestinationRepositoryDescriptor destination, Collection<IUDescription> seedIUs, MirrorOptions mirrorOptions, BuildOutputDirectory tempDirectory) throws FacadeException {
IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory);
try {
final MirrorApplication mirrorApp = createMirrorApplication(sources, destination, agent, mirrorOptions.isIncludePacked());
mirrorApp.setSlicingOptions(createSlicingOptions(mirrorOptions));
mirrorApp.setIgnoreErrors(mirrorOptions.isIgnoreErrors());
try {
// we want to see mirror progress as this is a possibly long-running operation
mirrorApp.setVerbose(true);
mirrorApp.setLog(new LogListener(mavenContext.getLogger()));
mirrorApp.setSourceIUs(querySourceIus(seedIUs, mirrorApp.getCompositeMetadataRepository(), sources));
IStatus returnStatus = mirrorApp.run(null);
checkStatus(returnStatus, mirrorOptions.isIgnoreErrors());
} catch (ProvisionException e) {
throw new FacadeException(MIRROR_FAILURE_MESSAGE + ": " + StatusTool.collectProblems(e.getStatus()), e);
}
} finally {
agent.stop();
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class PublisherServiceImpl method validateProfile.
void validateProfile(File profileFile) throws FacadeException {
Properties profileProperties = new Properties();
try {
FileInputStream stream = new FileInputStream(profileFile);
try {
profileProperties.load(stream);
validateProfile(profileProperties, profileFile);
} finally {
stream.close();
}
} catch (IOException e) {
throw new FacadeException(e);
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class VerifyIntegrityRepositoryMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
File repositoryDir = getBuildDirectory().getChild("repository");
logger.info("Verifying p2 repositories in " + repositoryDir);
VerifierService verifier = p2.getService(VerifierService.class);
URI repositoryUri = repositoryDir.toURI();
try {
if (!verifier.verify(repositoryUri, repositoryUri, getBuildDirectory())) {
throw new MojoFailureException("The repository is invalid.");
}
} catch (FacadeException e) {
throw new MojoExecutionException("Verification failed", e);
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class Activator method createProvisioningAgent.
public static IProvisioningAgent createProvisioningAgent(final BuildOutputDirectory targetDirectory) throws FacadeException {
ServiceReference<?> serviceReference = context.getServiceReference(IProvisioningAgentProvider.SERVICE_NAME);
IProvisioningAgentProvider agentFactory = (IProvisioningAgentProvider) context.getService(serviceReference);
try {
return agentFactory.createAgent(targetDirectory.getChild("p2agent").toURI());
} catch (ProvisionException e) {
throw new FacadeException(e);
} finally {
context.ungetService(serviceReference);
}
}
Aggregations