maveneclipse-plugintychoeclipse-pde

Missing plugin and feature folders for an update site built with Maven Tycho


I am building an eclipse plugin with Tycho. I want to create an Update Site for it. I have the following components:

But when I run mvn clean package in the target folder of my update site project I have:

├── lorem-ipsum-eclipse-update-1.0.1-SNAPSHOT.zip
├── local-artifacts.properties
├── p2agent
│   ├── org.eclipse.equinox.p2.core
│   │   └── cache
│   │       └── artifacts.xml
│   └── org.eclipse.equinox.p2.engine
│       └── profileRegistry
├── p2artifacts.xml
├── p2content.xml
├── repository
│   ├── artifacts.jar
│   ├── artifacts.xml.xz
│   ├── content.jar
│   ├── content.xml.xz
│   └── p2.index
└── targetPlatformRepository
    └── content.xml

As you can see the plugin and feature folders are missing in target/repository. This is my parent pom:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.lorem.ipsum.eclipse</groupId>
    <version>1.0.1-SNAPSHOT</version>
    <artifactId>lorem-ipsum-eclipse-parent</artifactId>
    <packaging>pom</packaging>

    <properties>
        <tycho-version>2.2.0</tycho-version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <modules>
        <module>lorem-ipsum-eclipse-feature</module> <!-- packaging: eclipse-feature -->
        <module>lorem-ipsum-eclipse-plugin</module>  <!-- packaging: eclipse-plugin -->
        <module>lorem-ipsum-eclipse-update</module>  <!-- packaging: eclipse-repository -->
    </modules>

    <repositories>
        <repository>
            <id>2020-12</id>
            <layout>p2</layout>
            <url>http://download.eclipse.org/releases/2020-12</url>
        </repository>
    </repositories>

    <build>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho-version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-p2-repository-plugin</artifactId>
                <version>${tycho-version}</version>
                <configuration>
                    <includeAllDependencies>true</includeAllDependencies>
                    <createArtifactRepository>true</createArtifactRepository>
                    <compress>true</compress>
                </configuration>
            </plugin>
            <!--Enable the replacement of the SNAPSHOT version in the final product configuration-->
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-packaging-plugin</artifactId>
                <version>${tycho-version}</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <id>package-feature</id>
                        <configuration>
                            <finalName>${project.artifactId}_${unqualifiedVersion}.${buildQualifier}</finalName>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

What am I doing wrong?

Thanks in advance.

UPDATE: As howlger requested here is update site's category.xml.

<?xml version="1.0" encoding="UTF-8"?>
<site>
   <feature id="com.lorem.ipsum.eclipse.feature" version="0.0.0">
      <category name="com.lorem.ipsum.eclipse.category"/>
   </feature>
   <category-def name="com.lorem.ipsum.eclipse.category" label="Lorem Ipsum">
      <description>
         Contains features for Lorem Ipsum plugin
      </description>
   </category-def>
</site>

By the way my file is named site.xml because if I named category.xml I have this error when i tried to run any maven goal:

$ mvn clean
...
[ERROR] Cannot resolve project dependencies:
[ERROR]   Software being installed: lorem-ipsum-eclipse-update raw:1.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.1-SNAPSHOT
[ERROR]   Missing requirement: lorem-ipsum-eclipse-update raw:1.0.1.'SNAPSHOT'/format(n[.n=0;[.n=0;[-S]]]):1.0.1-SNAPSHOT requires 'org.eclipse.equinox.p2.iu; com.lorem.ipsum.eclipse.feature.feature.group 0.0.0' but it could not be found
[ERROR] 
[ERROR] See https://wiki.eclipse.org/Tycho/Dependency_Resolution_Troubleshooting for help.
[ERROR] Cannot resolve dependencies of MavenProject: com.globant.augmented.coding.eclipse:lorem-ipsum-eclipse-update:1.0.1-SNAPSHOT @ /home/me/workspaces/java/lorem-ipsum-eclipse-project/lorem-ipsum-eclipse-update/pom.xml: See log for details -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MavenExecutionException

I followed the instructions of the book Eclipse 4 Plug-in Development by Example Beginners Guide by Dr Alex Blewitt which uses an old version of tycho (0.18.0) and I have used 2.2.0. Maybe in this version they fixed the fact of renaming site to category since in the same book they mentioned that it was a meaningless change. I quote:

Rename the site.xml file to category.xml . (This is an entirely pointless change required by p2 since the files are identical in format.)


Solution

  • According the the error message (... lorem-ipsum-eclipse-update ... Missing requirement: ... com.lorem.ipsum.eclipse.feature.feature.group ...) the update site category.xml refers a missing feature.

    Make sure to use the same feature ID (<feature id="...") in the following two files:

    See also the vogella tutorial Eclipse Tycho for building Eclipse Plug-ins and RCP applications: in category.xml the feature is referenced via the ID com.vogella.tycho.feature.

    com.vogella.tycho.feature