-->

Project files created with the maven-eclipse-plugi

2019-07-09 23:14发布

问题:

We have a really simple Tycho project:

<properties>
    <tycho-version>0.26.0</tycho-version>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.build.timestamp.format>yyyyMMdd_HHmmss</maven.build.timestamp.format>
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-maven-plugin</artifactId>
            <extensions>true</extensions>
            <version>${tycho-version}</version>
        </plugin>

        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>target-platform-configuration</artifactId>
            <version>${tycho-version}</version>
            <!-- snipped because probably not relevant -->
        </plugin>
    </plugins>
</build>

When we execute the maven goal eclipse:eclipse, we get the following weird comment in the .project files of features and products:

NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.

(A nonsense exception, because we execute it on the command line, there is no M2Eclipse involved at all.)

We could probably live with that, but the .classpath files look like that:

<classpathentry kind="lib" path="C:/Users/WileCoyote/.m2/repository/p2/osgi/bundle/com.itextpdf/5.5.3/com.itextpdf-5.5.3.jar"/>
<classpathentry kind="lib" path="C:/Users/WileCoyote/.m2/repository/p2/osgi/bundle/org.acme.config/2.0.2.v201506191015/org.acme.config-2.0.2.v201506191015.jar"/>
<!-- etc. -->

And so if imported in another user's workspace, these projects don't work anymore.

Here is an explanation on how to fix the problem, but that's really a no-brainer (remove the broken class path entries from the class path, because features and products don't need them anyway).

What I really want to know is why it happens at all? What is the problem? How do I fix it?

标签: m2e tycho