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

五迷三道 提交于 2019-12-11 00:55:00

问题


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?

来源:https://stackoverflow.com/questions/42621108/project-files-created-with-the-maven-eclipse-plugin-are-not-supported-in-m2eclip

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!