use of org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices in project tycho by eclipse.
the class P2ResolverFactoryImpl method getLocalArtifactRepository.
private static synchronized LocalArtifactRepository getLocalArtifactRepository(MavenContext mavenContext, LocalRepositoryP2Indices localRepoIndices) {
if (localArtifactRepository == null) {
RepositoryReader contentLocator = new LocalRepositoryReader(mavenContext.getLocalRepositoryRoot());
localArtifactRepository = new LocalArtifactRepository(localRepoIndices, contentLocator);
}
return localArtifactRepository;
}
use of org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices in project tycho by eclipse.
the class P2ResolverFactoryImpl method getLocalMetadataRepository.
private static synchronized LocalMetadataRepository getLocalMetadataRepository(MavenContext context, LocalRepositoryP2Indices localRepoIndices) {
if (localMetadataRepository == null) {
File localMavenRepoRoot = context.getLocalRepositoryRoot();
RepositoryReader contentLocator = new LocalRepositoryReader(localMavenRepoRoot);
localMetadataRepository = new LocalMetadataRepository(localMavenRepoRoot.toURI(), localRepoIndices.getMetadataIndex(), contentLocator);
}
return localMetadataRepository;
}
use of org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices in project tycho by eclipse.
the class UpdateLocalIndexMojo method execute.
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
LocalRepositoryP2Indices localRepoIndices = serviceFactory.getService(LocalRepositoryP2Indices.class);
GAV gav = new GAV(project.getGroupId(), project.getArtifactId(), project.getArtifact().getVersion());
TychoRepositoryIndex artifactsIndex = localRepoIndices.getArtifactsIndex();
TychoRepositoryIndex metadataIndex = localRepoIndices.getMetadataIndex();
try {
addGavAndSave(gav, artifactsIndex);
addGavAndSave(gav, metadataIndex);
} catch (IOException e) {
throw new MojoExecutionException("Could not update local repository index", e);
}
}
use of org.eclipse.tycho.p2.repository.LocalRepositoryP2Indices in project tycho by eclipse.
the class LocalArtifactRepositoryFactory method lookupLocalRepoIndices.
protected LocalRepositoryP2Indices lookupLocalRepoIndices() {
final BundleContext context = Activator.getContext();
ServiceReference<LocalRepositoryP2Indices> localRepoIndicesRef = context.getServiceReference(LocalRepositoryP2Indices.class);
if (localRepoIndicesRef != null) {
LocalRepositoryP2Indices localRepoIndices = context.getService(localRepoIndicesRef);
if (localRepoIndices != null) {
return localRepoIndices;
}
}
throw new IllegalStateException("service not registered: " + LocalRepositoryP2Indices.class.getName());
}
Aggregations