Categories are groupings of elements that are available for installation in the p2 user ui. For example, the categories in the Eclipse and Equinox site look something like this…
Ensuring that categories are generated in the content.jar has always been a bit tricky. You can generate a buildtime site.xml that’s used to specify the categories which is passed as an argument to the generator. However, this site.xml isn’t actually used in the repo because that’s old update manager technology. So 2007. You can also add the category name in a p2.inf. Again, not the most intuitive approach.
Today, John Arthorne proposed an interesting solution to this issue in bug 277359 that doesn’t require changes to the build scripts. The trick is to add a child metadata repository to your composite repository that only specifies your category IUs. The steps are as follows:
Add a “categories” directory to your composite repository
In the categories directory, add a content.jar that specifies the IUs of the of the categories you want to display. For the Eclipse project’s SDK category, the content.xml looks something like this…
The final task is to add the child repo “categories” to your compositeContent.jar in the root of your composite repository. You can use the p2 ant tasks to add the child repo or modify the CompositeContent.xml directly.