Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Equinox/p2/Console Users Guide"

< Equinox‎ | p2
m
m
Line 5: Line 5:
 
The P2 Provisioning Commands are console commands enabled by the presence of P2 that allow you to perform common provisioning operations, such as managing the repository and profiles, installing and removing components, etc.  
 
The P2 Provisioning Commands are console commands enabled by the presence of P2 that allow you to perform common provisioning operations, such as managing the repository and profiles, installing and removing components, etc.  
  
=== Prerequisties ===
+
=== Prerequisites ===
  
 
To have the Eclipse console available, you have to add '''-console''' as a program argument either in the ''Eclipse.ini'' file of your default Eclipse installation, or, in the ''Argument'' tab in your Eclipse IDE. See [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Eclipse Runtime Options] for more details
 
To have the Eclipse console available, you have to add '''-console''' as a program argument either in the ''Eclipse.ini'' file of your default Eclipse installation, or, in the ''Argument'' tab in your Eclipse IDE. See [http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/misc/runtime-options.html Eclipse Runtime Options] for more details
Line 86: Line 86:
  
 
<blockquote>
 
<blockquote>
1. Add MAT update site:
+
1. Prerequisite: Start the P2 console bundle
 +
<pre>
 +
osgi> ss p2.console
 +
 
 +
Framework is launched.
 +
 
 +
id      State      Bundle
 +
68      <<LAZY>>    org.eclipse.equinox.p2.console_1.0.300.v20101108
 +
 
 +
osgi> start 68
 +
</pre>
 +
2. Add MAT update site:
 
<pre>osgi> provaddrepo http://download.eclipse.org/mat/1.0/update-site/</pre>
 
<pre>osgi> provaddrepo http://download.eclipse.org/mat/1.0/update-site/</pre>
2. List IUs with group capabilities to check the exact name and version of the required IU:
+
3. List IUs with group capabilities to check the exact name and version of the required IU:
 
<pre>
 
<pre>
 
< ... omitted ...>
 
< ... omitted ...>
Line 94: Line 105:
 
< ... omitted ...>
 
< ... omitted ...>
 
</pre>
 
</pre>
3. Install the MAT IU:
+
4. Install the MAT IU:
 
<pre>provinstall org.eclipse.mat.feature.feature.group 1.0.100.201012150941</pre>
 
<pre>provinstall org.eclipse.mat.feature.feature.group 1.0.100.201012150941</pre>
4. Apply the changes we just made:
+
5. Restart Eclipse to allow P2 reconciler to install the new bundles (this is needed for UI contributions such as MAT)
<pre>confapply</pre>
+
6. You may now use your new MAT perspective
5. You may now use your new MAT perspective
+
 
</blockquote>
 
</blockquote>

Revision as of 11:03, 2 February 2011


Using P2 Provisioning Commands

The P2 Provisioning Commands are console commands enabled by the presence of P2 that allow you to perform common provisioning operations, such as managing the repository and profiles, installing and removing components, etc.

Prerequisites

To have the Eclipse console available, you have to add -console as a program argument either in the Eclipse.ini file of your default Eclipse installation, or, in the Argument tab in your Eclipse IDE. See Eclipse Runtime Options for more details

Enabling the Provisioning Commands

To run with the provisioning console commands enabled, make sure that the P2 console bundle is available and started in the process to which you want to connect the console:

1. Start the console.

2. Find the ID of the P2 console bundle by using the command (in the example "68"):

osgi> ss p2.console

Framework is launched.

id      State       Bundle
68      ACTIVE      org.eclipse.equinox.p2.console_1.0.300.v20110104-0005

3. Start the bundle:

osgi> start 68

4. To list all the commands, type man in the console line. The P2 Provisioning Commands all start with "prov".

P2 Provisioning Commands

Repository Commands

provaddrepo <repository URI> 
Adds both metadata and artifact repository at URI
provdelrepo <repository URI> 
Deletes metadata and artifact repository at URI
provaddmetadatarepo <repository URI> 
Adds a metadata repository at URI
provdelmetadatarepo <repository URI> 
Deletes a metadata repository at URI
provaddartifactrepo <repository URI> 
Adds an artifact repository at URI
provdelartifactrepo <repository URI> 
Deletes an artifact repository URI
provlg [<repository URI> <iu id | *> <version range | *>] 
Lists all IUs with group capabilities in the given repository or in all repositories if URI is omitted
provlr [<repository URI> <iu id | *> <version range | *>] 
Lists all metadata repositories, or the contents of a given metadata repository
provlar [<repository URI>] 
Lists all artifact repositories, or the contents of a given artifact repository
provliu [<repository URI | *> <iu id | *> <version range | *>] 
Lists the IUs that match the pattern in the given repo. * matches all
provlquery <repository URI | *> <expression> [ true | false ] 
Lists the IUs that match the query expression in the given repo. * matches all. The expression is expected to be a boolean match expression unless the third argument is true, in which case the expression is a full query.

Profile Registry Commands

provaddprofile <profileid> <location> <flavor> 
Adds a profile with the given profileid, location and flavor
provdelprofile <profileid> 
Deletes a profile with the given profileid
provlp [<profileid | *>] 
Lists all profiles, or the contents of the profile at the given profile
provlgp [<profileid>] 
Lists all IUs with group capabilities in the given profile, or current profile if profileid is omitted
provlpts [<profileid>] 
Lists timestamps for given profile, or if no profileid given then the default profile timestamps are reported
provlpquery <profileid | this> <expression> [ true | false ] 
Lists the IUs that match the query expression in the given profile. The expression is expected to be a boolean match expression unless the third argument is true, in which case the expression is a full query

Install Commands

provinstall <InstallableUnit> <version> <profileid> 
installs an IU to the profileid. If no profileid is given, installs into the default profile.
provremove <InstallableUnit> <version> <profileid> 
Removes an IU from the profileid. If no profileid is given, installs into the default profile.
provrevert <profileTimestamp> [<profileid>] 
Reverts to a given profile time stamp for an optional profileId
Note.png
Apply changes
To see the applied configuration changes at runtime, you have to use the confapply command.


Note.png
Repositories
The install commands use only the previously added repositories. If your IU is part of a new custom repository, you have to add the repository manually using the provaddrepo command.


Example

To install Eclipse Memory Analyzer Tool (MAT) in Eclipse you have to:

1. Prerequisite: Start the P2 console bundle

osgi> ss p2.console

Framework is launched.

id      State       Bundle
68      <<LAZY>>    org.eclipse.equinox.p2.console_1.0.300.v20101108

osgi> start 68

2. Add MAT update site:

osgi> provaddrepo http://download.eclipse.org/mat/1.0/update-site/

3. List IUs with group capabilities to check the exact name and version of the required IU:

< ... omitted ...>
org.eclipse.mat.feature.feature.group 1.0.100.201012150941
< ... omitted ...>

4. Install the MAT IU:

provinstall org.eclipse.mat.feature.feature.group 1.0.100.201012150941

5. Restart Eclipse to allow P2 reconciler to install the new bundles (this is needed for UI contributions such as MAT) 6. You may now use your new MAT perspective

Copyright © Eclipse Foundation, Inc. All Rights Reserved.