I try to use my legacy code in my Eclipe-RCP Application. I took all my old maven projects with dependencies and used the maven-bundle-plugin to create an osgi bundle.
Now i have everything wrapped up in a new osgi jar.
How to create a p2 update site from this OSGi jar to use with Tycho and the Eclipse target platform?
I tried: https://docs.sonatype.org/display/TYCHO/How+to+make+existing+OSGi+bundles+consumable+by+Tycho (see web archive)
Publishing a P2 Repository
Prerequisites:
- Local Eclipse Galileo installation in %ECLIPSE_HOME% We want to generate P2 metadata for a bunch of OSGi bundles which we have locally in the filesystem. Eclipse provides the FeaturesAndBundlesPublisher command line application for this task.
- First of all we copy all bundle jars into a <BUNDLE_ROOT>/plugins directory
- Then we execute
%ECLIPSE_HOME%\eclipsec.exe -debug -consolelog -nosplash -verbose -application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher -metadataRepository file:/<BUNDLE_ROOT>/repo -artifactRepository file:<BUNDLE_ROOT>/repo -source <BUNDLE_ROOT> -compress -publishArtifacts
- The result is a P2 repository with all OSGi bundles under <BUNDLE_ROOT>/repo. Note the generated P2 metadata files artifacts.jar and content.jar in the repo directory.
Making the New P2 Repository Available via HTTP
The P2 repository in <BUNDLE_ROOT>/repo is complete, we just need to make it available via HTTP so it can be globally referenced.
This could be done using any HTTP server such as Apache. In our case we chose to deploy it on Tomcat as we already have a tomcat running for other purposes such as Hudson etc.
On the host running tomcat, copy the contents of <BUNDLE_ROOT>/repo to <TOMCAT_HOME>/webapps/<YOUR_REPO_DIR>
From now on you could reference this P2 repository in pom.xml as
<repository> <id>tomcat-p2</id> <layout>p2</layout> <url>http://<TOMCAT_HOST>:<TOMCAT_PORT>/<YOUR_REPO_DIR></url> </repository>
If i put the resulting files on a web server eclipse is not recognizing it as "Software Site".
How to create a p2 Software Site from existing osgi bundles without using the Eclipse UI, the process has to run in background on my build-server.
Is there a way to use Maven (Tycho)/ Gradle to automatically create a p2 update site from an existing osgi bundle?