Skip to content

Instantly share code, notes, and snippets.

@matthewromano
Created November 6, 2011 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewromano/1343506 to your computer and use it in GitHub Desktop.
Save matthewromano/1343506 to your computer and use it in GitHub Desktop.
Add a P2 Repository at runtime to and Eclipse RCP Application
private void addRuntimeP2Repository(IProgressMonitor monitor, ProvisioningSession session, URI runtimeRepoURI) throws ProvisionException, OperationCanceledException {
//Create Metadata repository manager and add the new repository location
IMetadataRepositoryManager metaDataRepoManager = ProvUI.getMetadataRepositoryManager(session);
metaDataRepoManager.loadRepository(runtimeRepoURI, monitor);
//Create artifact repository manager and add the new repository location
IArtifactRepositoryManager artifactDataRepoManager = ProvUI.getArtifactRepositoryManager(session);
artifactDataRepoManager.loadRepository(runtimeRepoURI, monitor);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment