Search in sources :

Example 16 with RepositoryReferences

use of org.eclipse.tycho.p2.tools.RepositoryReferences 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

RepositoryReferences (org.eclipse.tycho.p2.tools.RepositoryReferences)10 File (java.io.File)6 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)4 Test (org.junit.Test)4 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)3 MojoFailureException (org.apache.maven.plugin.MojoFailureException)3 DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 IStatus (org.eclipse.core.runtime.IStatus)2 IProvisioningAgent (org.eclipse.equinox.p2.core.IProvisioningAgent)2 ProvisionException (org.eclipse.equinox.p2.core.ProvisionException)2 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)2 TargetPlatformConfiguration (org.eclipse.tycho.core.TargetPlatformConfiguration)2 TargetEnvironment (org.eclipse.tycho.core.shared.TargetEnvironment)2 DestinationRepositoryDescriptor (org.eclipse.tycho.p2.tools.DestinationRepositoryDescriptor)2 IUDescription (org.eclipse.tycho.p2.tools.mirroring.facade.IUDescription)2 FileOutputStream (java.io.FileOutputStream)1 MalformedURLException (java.net.MalformedURLException)1 HashSet (java.util.HashSet)1