Search in sources :

Example 16 with DependencySeed

use of org.eclipse.tycho.core.resolver.shared.DependencySeed 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

DependencySeed (org.eclipse.tycho.core.resolver.shared.DependencySeed)16 File (java.io.File)8 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)6 ArrayList (java.util.ArrayList)5 Test (org.junit.Test)5 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)4 ResourceUtil.resourceFile (org.eclipse.tycho.p2.tools.test.util.ResourceUtil.resourceFile)4 FacadeException (org.eclipse.tycho.p2.tools.FacadeException)3 MojoFailureException (org.apache.maven.plugin.MojoFailureException)2 RepositoryReferences (org.eclipse.tycho.p2.tools.RepositoryReferences)2 PublisherService (org.eclipse.tycho.p2.tools.publisher.facade.PublisherService)2 TychoMatchers.isFile (org.eclipse.tycho.test.util.TychoMatchers.isFile)2 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 IProductDescriptor (org.eclipse.equinox.internal.p2.publisher.eclipse.IProductDescriptor)1 IProvidedCapability (org.eclipse.equinox.p2.metadata.IProvidedCapability)1 InstallableUnitDescription (org.eclipse.equinox.p2.metadata.MetadataFactory.InstallableUnitDescription)1 Version (org.eclipse.equinox.p2.metadata.Version)1 VersionedId (org.eclipse.equinox.p2.metadata.VersionedId)1 IPublisherAdvice (org.eclipse.equinox.p2.publisher.IPublisherAdvice)1