Generating a p2 repository from a local folder, so that it can be used in a target platform

2k views Asked by At

I want to build an RCP application with Maven and Tycho. For this I need to change my target platform which is only a folder in the file-system to a p2 repository. To generate the p2 repository I created a new workspace, set the target platform and followed this tutorial.

Eclipse generates a p2 repository for me and all seems fine, but when I want to set this generated p2 repository as target platform in Eclipse it fails. Eclipse says that org.eclipse.swtbot.eclipse.finder requires the package javax.swing.text. I searched a bit and found out that javax.swing.text is a part from the JDK, and some people somehow managed to get the JDK into the p2 repository.

How can I to satisfy this dependency and make the target resolution pass?

2

There are 2 answers

1
jsievers On

This is an effect of the JDK itself not being an OSGi bundle. The eclipse release train repositories have a fake "a.jre.javase" installable unit which provide all the packages in the JDK to work around this problem.

Try adding http://download.eclipse.org/releases/indigo to the p2 repositories of your build.

Also se related bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=364095

0
Jarek Przygódzki On

Threre's a "special" IU that represents the packages provided by the JDK. There's whole discussion about generating a.jre.javase IU at Eclipse Community Forums: [p2] how to generate "a.jre.javase" IU?. Here's p2 metadata publisher creating JRE IU based on Phil Denis sample. Alternatively, IU can be created by this p2 advice file (p2.inf).