Reputation: 4103
I have a normal Eclipse plug-in build with Tycho, and want to build an update site with the very same Tycho. My problem is figuring out how to get the artifact from its Maven GAVs (or optionally the JAR) into the update site.
What I tried:
<plugin>
<groupId>org.eclipse.tycho.extras</groupId>
<artifactId>tycho-p2-extras-plugin</artifactId>
<version>${tycho.version}</version>
<executions>
<execution>
<id>add-to-update-site</id>
<phase>install</phase>
<goals>
<goal>mirror</goal>
</goals>
<configuration>
<source>
<repository>
<url>${project.baseUri}/target/repository</url>
</repository>
</source>
<destination>${project.basedir}</destination>
<append>true</append>
</configuration>
</execution>
</executions>
</plugin>
This takes the repository from target/repository and merges it with the one in the base directory of the project. So every plug-in in target/repository will be added to the update site.
This works with a target platform file, but of course not with Maven GAVs or JAR. I tried adding the plug-in as a dependency and using dependency:copy-dependencies
, but this will not create a P2 repository.
There is the plug-in tycho-p2-repository:assemble-repository, but I'm not sure it can help me create a P2 repository for tycho-p2-extras-plugin
to consume. Or even as standalone.
I found reficio's p2-maven-plugin, which can generate P2 repositories from JARs, but it doesn't support Tycho at all.
I feel like I'm only one step away from a solution. So how do I build a P2 repository from Maven GAVs (or JAR files)?
Upvotes: 1
Views: 374
Reputation: 4103
That is not possible with Tycho. So I used the command line:
SET ECLIPSE_HOME=S:/Development/Eclipse 2018-12
SET EQUINOX_VERSION=1.5.200.v20180922-1751
SET CURRENT_PATH=%~dp0
SET SOURCE_REPOSITORY=%CURRENT_PATH%\dropin
SET TARGET_REPOSITORY=%CURRENT_PATH%\
java -jar "%ECLIPSE_HOME%/plugins/org.eclipse.equinox.launcher_%EQUINOX_VERSION%.jar"
-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher
-metadataRepository "file:/%TARGET_REPOSITORY%" -artifactRepository "file:/%TARGET_REPOSITORY%"
-source "%SOURCE_REPOSITORY%" -publishArtifacts -append
However I haven't been able to create categories, so the repository appears to be empty on default.
Upvotes: 0