M2Eclipse:如何避免 M2E 在 maven 更新工作区中的项目时更改我的类路径

M2Eclipse: How to avoid M2E to change my classpath while maven updating project in workspace

我正在做一些 eclipse 插件开发,我已经生成了我的自定义类路径,例如 <classpathentry kind="src" output="target/classes" path="src/main/webapp"/> ,但是当我右键单击 -> maven -> maven 更新项目时,它(M2E)将覆盖我的类路径为

<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/webapp">
        <attributes>
            <attribute name="maven.pomderived" value="true"/>
        </attributes>
    </classpathentry>

其实,这会给我的生意带来很多问题。有什么方法可以配置或代码注入来避免更改吗?任何帮助表示赞赏。

pom(项目对象模型)的目的是在一个中心位置包含有关构建/class 路径的所有信息。更新maven项目时,pom.xml文件的信息会update/override.classpath文件

=> 不要手动更改 .classpath 文件,而是将信息包含在 pom.xml 文件中。

对于 Eclipse 插件,您可能希望删除项目的 Maven 性质,因为 Eclipse 插件有自己的方式来定义依赖项,请参阅 MANIFEST.MF