Search code examples
javaeclipsemavenpluginstycho

Plugin build failure with maven tycho


I'm trying to build my Eclipse product with Tycho. I have all the pom structures created, with a parent pom in the root directory and child poms in product, plugin, and feature, but when I try to execute mvn clean veryfy or mvn install in a terminal in the root directory, the command fails.

This is the error that the console provides.

Console Error

I tried to add repositories to the parent pom, trying to resolve the dependencies, but it didn't work. I tried to add the repositories to Eclipse too, but it didn't work anyway.

Here is my parent pom.xml:

<project
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://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.sisnet.ide</groupId>
    <artifactId>ParentSISnetRCP</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <properties>
        <tycho.version>2.7.5</tycho.version>
        <project.build.sourceEncoding>ISO-8859-15</project.build.sourceEncoding>
        <eclipse-repo.url>https://download.eclipse.org/releases/latest</eclipse-repo.url>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-p2-director-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>

        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
            </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>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <!-- Optional set the Java version you are using-->
                    <!--
                    <executionEnvironment>JavaSE-17</executionEnvironment>-->
                    <environments>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>macosx</os>
                            <ws>cocoa</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <modules>
        <!--TODO ADD YOUR MODULES HERE-->
        <module>com.sisnet.ide.target</module>
        <module>com.sisnet.ide.feature</module>
        <module>com.sisnet.ide.plugin</module>
        <module>com.sisnet.ide.product</module>
    </modules>

</project>

Solution

  • The error says that your plugin com.sisnet.ide.plugin requires org.sonarlint.eclipse.ui 7.10.0 or higher, but which is missing.

    In your target definition file (*.target) add the following location:

    <location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
        <unit id="org.sonarlint.eclipse.feature.feature.group" version="0.0.0"/>
        <repository location="https://eclipse-uc.sonarlint.org"/>
    </location>