Reputation: 351
project structure:
category.xml
<?xml version="1.0" encoding="UTF-8"?>
<site>
<feature id="com.test.A.feature" version="0.0.0">
<category name="com.test.A.repository"/>
</feature>
<feature id="com.test.A.feature.source" version="0.0.0">
<category name="com.test.A.repository"/>
</feature>
<category-def name="com.test.A.repository" label="Test A"/>
</site>
pom.xml
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.test</groupId>
<artifactId>build</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<tycho.version>4.0.10</tycho.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>com.test.A</module>
<module>com.test.A.feature</module>
<module>com.test.A.repository</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<configuration>
<format>yyyyMMdd-HHmm</format>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<executions>
<execution>
<id>plugin-source</id>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
<execution>
<id>feature-source</id>
<goals>
<goal>feature-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-packaging-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
build:
mvn clean verify
error:
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] build 0.0.1-SNAPSHOT ............................... SUCCESS [ 0.126 s]
[INFO] [bundle] A 1.0.0-SNAPSHOT .......................... SUCCESS [ 2.514 s]
[INFO] [feature] A Feature 1.0.0-SNAPSHOT ................. SUCCESS [ 0.507 s]
[INFO] [updatesite] com.test.A.repository.eclipse-repository 0.0.1-SNAPSHOT FAILURE [ 0.079 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.819 s
[INFO] Finished at: 2024-11-27T19:44:00+08:00
[INFO] ------------------------------------------------------------------------
[ERROR] Cannot resolve dependencies of project com.test:com.test.A.repository.eclipse-repository:eclipse-repository:0.0.1-SNAPSHOT
[ERROR] with context {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64, org.eclipse.update.install.sources=true}
[ERROR] Software being installed: com.test.A.repository.eclipse-repository raw:0.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.1-SNAPSHOT
[ERROR] Missing requirement: com.test.A.repository.eclipse-repository raw:0.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):0.0.1-SNAPSHOT requires 'org.eclipse.equinox.p2.iu; com.test.A.feature.source.feature.group 0.0.0' but it could not be found: See log for details
[ERROR] -> [Help 1]
Why isn't A source feature
automatically generated?
I referenced these articles:
11.5. Building source features
Tycho 12: Build source features
there seems to be no relevant omissions. Am I missing something? Thanks.
Solution:
need tycho-p2-plugin:p2-metadata
...
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<executions>
<execution>
<id>p2-metadata</id>
<goals>
<goal>p2-metadata</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
</plugin>
...
While the problem is solved, I still don't know what it actually did, does anyone know? Thanks.
Upvotes: 1
Views: 27