I am trying to create a categorized p2 repository using Tycho. There are three steps to this (compare the Eclipse Documentation ):
- Download Packages
- Trigger org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher
- Trigger org.eclipse.equinox.p2.publisher.CategoryPublisher
which I configured in the maven pom file. Steps 1 and 2 succeed, while step 3 fails:
Status ERROR: this code=0 publishing result null children=[Status ERROR: org.eclipse.equinox.p2.updatesite code=0 Error generating category xml action. org.eclipse.equinox.p2.core.ProvisionException: Error reading update site file:/<path>/category.xml.]
Here is my pom.file
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001 XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>demo</groupId> <artifactId>simple-p2-repository</artifactId> <version>0.1.0-SNAPSHOT</version> <name>Simple p2 repository build</name> <packaging>pom</packaging> <properties> <tycho-version>0.18.0</tycho-version> </properties> <build> <plugins> <plugin> <artifactId>maven-dependency-plugin</artifactId> <executions> <execution> <id>copy-bundles-for-publishing</id> <phase>process-resources</phase> <goals> <goal>copy</goal> </goals> <configuration> <artifactItems> <artifactItem> <groupId>org.apache.cxf</groupId> <artifactId>cxf-bundle</artifactId> <version>2.7.5</version> </artifactItem> </artifactItems> <outputDirectory>${project.basedir}/target/source/plugins</outputDirectory> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.eclipse.tycho.extras</groupId> <artifactId>tycho-p2-extras-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <phase>prepare-package</phase> <goals> <goal>publish-features-and-bundles</goal> </goals> </execution> </executions> <configuration> <compress>true</compress> <append>true</append> <publishArtifacts>true</publishArtifacts> </configuration> </plugin> <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-p2-plugin</artifactId> <version>${tycho-version}</version> <executions> <execution> <phase>package</phase> <goals> <goal>category-p2-metadata</goal> </goals> </execution> </executions> <configuration> <target>${basedir}/target/repository</target> <categoryDefinition>${basedir}/category.xml</categoryDefinition> </configuration> </plugin> </plugins> </build> </project>
And my category.xml
<?xml version="1.0" encoding="UTF-8"?> <site> <category-def name="all" label="Maven osgi-bundles"/> <iu> <category name="all"/> <query> <expression type="match">providedCapabilities.exists(p | p.namespace == 'osgi.bundle')</expression> </query> </iu> </site>
If I manually followed the steps, the same error will occur. What am I missing?
eclipse maven eclipse-rcp tycho
Achim
source share