Package dev.equo.solstice.p2
A simple implementation of p2 with the goal of making p2 an optional component of a project. It
accomplishes this by making it possible to incrementally switch some artifacts off of p2 and onto
maven central.
var session = new P2Session(); // stores all p2 metadata in memory
try (var client = new P2Client(cacheDir)) { // loads p2 metadata from a URL (and a disk cache) into the session
session.populateFrom(client, "https://download.eclipse.org/eclipse/updates/4.26")
}
var query = new P2Query(); // stores the results of a query against the p2 metadata, including requires/provides
query.platform(SwtPlatform.getRunning()); // filters artifacts based on the platform
query.resolve(session.getUnitById("org.eclipse.platform.ide.categoryIU")); // resolves dependencies of the given IU
for (String mavenCoord : query.jarsOnMavenCentral()) {
System.out.println("maven coordinate: " + mavenCoord);
}
for (P2Unit iu : query.jarsNotOnMavenCentral()) {
System.out.println("p2 only: " + ui.getId());
}
-
Interface Summary Interface Description P2Session.Requirement Keeps track of every unit which provides the given capability. -
Class Summary Class Description CacheLocations There are a few things which EquoIDE needs to cache on the developer's machine.ConsoleTable Formats P2Unit for display at the console.P2Client Performs network requests and parsing against a P2 repository, aided by caching.P2Model P2Model.Filter P2Multitool P2Query Follows the dependency information of a set ofP2Unitso that they can be installed from maven or directly from p2 if necessary.P2QueryResult P2Session In-memory store of all p2 metadata, especially provides/requires dependency information.P2Unit Usually represents a jar file in a p2 repository, but could also be a "feature" or "group".RepoStatus Determines where a P2Unit is available.WorkspaceRegistry Maintains a registry of EquoIDE workspaces. -
Enum Summary Enum Description ConsoleTable.Format Determines which format to print the table in.P2ClientCache The various caching modes thatP2Clientsupports.P2Multitool.All P2QueryCache