Search in sources :

Example 1 with MirrorApplicationService

use of org.eclipse.tycho.p2.tools.mirroring.facade.MirrorApplicationService 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);
    }
}
Also used : DependencySeed(org.eclipse.tycho.core.resolver.shared.DependencySeed) FacadeException(org.eclipse.tycho.p2.tools.FacadeException) RepositoryReferences(org.eclipse.tycho.p2.tools.RepositoryReferences) MirrorApplicationService(org.eclipse.tycho.p2.tools.mirroring.facade.MirrorApplicationService) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) MojoFailureException(org.apache.maven.plugin.MojoFailureException) File(java.io.File) TargetPlatformConfiguration(org.eclipse.tycho.core.TargetPlatformConfiguration) DestinationRepositoryDescriptor(org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor)

Aggregations

File (java.io.File)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 MojoFailureException (org.apache.maven.plugin.MojoFailureException)1 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)1 DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)1 DestinationRepositoryDescriptor (org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor)1 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)1 RepositoryReferences (org.eclipse.tycho.p2.tools.RepositoryReferences)1 MirrorApplicationService (org.eclipse.tycho.p2.tools.mirroring.facade.MirrorApplicationService)1