Prepare a directory of your choice that will contain your plug-ins and features that should be packed into a p2 repository. It can be any directory but needs to contain a folder named
Place all your plug-ins into the
plugins folder, all features into the
providedCapabilities.exists(p | p.namespace == 'osgi.bundle')
- Execute the Features and Bundles Publisher Application which will generate the p2 repository for you:
java -jar bin/eclipse-rcp-mars/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:$repo_target -artifactRepository file:$repo_target -source $repo_source -configs gtk.linux.x86_64 -publishArtifacts
- Execute the Category Publisher:
java -jar bin/eclipse-rcp-mars/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar -application org.eclipse.equinox.p2.publisher.CategoryPublisher -metadataRepository file:$repo_target -categoryDefinition file:$category_file_location
- The generated repository will look like this:
The p2-repository is ready for local use!
- As a next step, you can copy the repository to a location accessible via HTTP, as a Tycho build e.g. is not able to use a local p2 repository (See here).
- If you are developing some libraries using maven and would like to put them to your p2-repository as well, you can prepare them as described here.
- If you would like to use some third-party libs, such as apache-commons, you can convert them into OSGi/ p2 compatible plug-ins and publish them into another p2-repository using the p2-maven-plugin.