use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class VerifierServiceImpl method verify.
@Override
public boolean verify(URI metadataRepositoryUri, URI artifactRepositoryUri, BuildOutputDirectory tempDirectory) throws FacadeException {
MavenLogger logger = mavenContext.getLogger();
logger.debug("Checking metadata from '" + metadataRepositoryUri + "' and artifacts from '" + artifactRepositoryUri + "'");
IProvisioningAgent agent = Activator.createProvisioningAgent(tempDirectory);
try {
try {
final IMetadataRepository metadata = loadMetadataRepository(metadataRepositoryUri, agent);
final IArtifactRepository artifactRepository = loadArtifactRepository(artifactRepositoryUri, agent);
boolean valid = true;
valid &= verifyReferencedArtifactsExist(metadata, artifactRepository, logger);
valid &= verifyAllArtifactContent(artifactRepository, logger);
if (valid) {
logger.info("The integrity of the metadata repository '" + metadataRepositoryUri + "' and artifact repository '" + artifactRepositoryUri + "' has been verified successfully");
}
return valid;
} catch (ProvisionException e) {
throw new FacadeException(e);
}
} finally {
agent.stop();
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class PublishCategoriesMojo method publishContent.
@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments());
try {
List<DependencySeed> categoryIUs = new ArrayList<>();
for (Category category : getCategories()) {
final File buildCategoryFile = prepareBuildCategory(category, getBuildDirectory());
Collection<DependencySeed> ius = publisherService.publishCategories(buildCategoryFile);
categoryIUs.addAll(ius);
}
return categoryIUs;
} catch (FacadeException e) {
throw new MojoExecutionException("Exception while publishing categories: " + e.getMessage(), e);
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class PublishEEProfileMojo method publishContent.
@Override
protected Collection<DependencySeed> publishContent(PublisherServiceFactory publisherServiceFactory) throws MojoExecutionException, MojoFailureException {
PublisherService publisherService = publisherServiceFactory.createPublisher(getReactorProject(), getEnvironments());
try {
Collection<DependencySeed> ius = publisherService.publishEEProfile(profileFile);
getLog().info("Published profile IUs: " + ius);
return ius;
} catch (FacadeException e) {
throw new MojoExecutionException("Exception while publishing execution environment profile " + profileFile + ": " + e.getMessage(), e);
}
}
use of org.eclipse.tycho.p2.tools.FacadeException in project tycho by eclipse.
the class AssembleRepositoryMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
try {
File destination = getAssemblyRepositoryLocation();
destination.mkdirs();
copyResources(destination);
Collection<DependencySeed> projectSeeds = TychoProjectUtils.getDependencySeeds(getProject());
if (projectSeeds.size() == 0) {
throw new MojoFailureException("No content specified for p2 repository");
}
RepositoryReferences sources = getVisibleRepositories();
TargetPlatformConfiguration configuration = TychoProjectUtils.getTargetPlatformConfiguration(getProject());
MirrorApplicationService mirrorApp = p2.getService(MirrorApplicationService.class);
DestinationRepositoryDescriptor destinationRepoDescriptor = new DestinationRepositoryDescriptor(destination, repositoryName, compress, xzCompress, keepNonXzIndexFiles, !createArtifactRepository, true);
mirrorApp.mirrorReactor(sources, destinationRepoDescriptor, projectSeeds, getBuildContext(), includeAllDependencies, configuration.isIncludePackedArtifacts(), profileProperties);
} catch (FacadeException e) {
throw new MojoExecutionException("Could not assemble p2 repository", e);
}
}
Aggregations