Search in sources :

Example 1 with PublishingRepositoryFacade

use of org.eclipse.tycho.repository.registry.facade.PublishingRepositoryFacade in project tycho by eclipse.

the class AttachPublishedArtifactsMojo method execute.

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    ReactorRepositoryManagerFacade reactorRepoManager = osgiServices.getService(ReactorRepositoryManagerFacade.class);
    PublishingRepositoryFacade publishingRepo = reactorRepoManager.getPublishingRepository(getProjectIdentities());
    Map<String, File> artifacts = publishingRepo.getArtifactLocations();
    for (Entry<String, File> entry : artifacts.entrySet()) {
        String classifier = entry.getKey();
        File artifactLocation = entry.getValue();
        if (classifier == null) {
            getProject().getArtifact().setFile(artifactLocation);
        } else {
            String type = getExtension(artifactLocation);
            projectHelper.attachArtifact(getProject(), type, classifier, artifactLocation);
        }
    }
    ReactorProject reactorProject = getReactorProject();
    reactorProject.setDependencyMetadata(true, publishingRepo.getInstallableUnits());
    reactorProject.setDependencyMetadata(false, Collections.emptySet());
}
Also used : ReactorRepositoryManagerFacade(org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManagerFacade) ReactorProject(org.eclipse.tycho.ReactorProject) PublishingRepositoryFacade(org.eclipse.tycho.repository.registry.facade.PublishingRepositoryFacade) File(java.io.File)

Aggregations

File (java.io.File)1 ReactorProject (org.eclipse.tycho.ReactorProject)1 PublishingRepositoryFacade (org.eclipse.tycho.repository.registry.facade.PublishingRepositoryFacade)1 ReactorRepositoryManagerFacade (org.eclipse.tycho.repository.registry.facade.ReactorRepositoryManagerFacade)1