如何在pom中修复maven-compiler-plugin配置,以免破坏Eclipse集成?

时间:2019-07-09 17:42:03

标签: eclipse maven pom.xml m2eclipse

我正在从另一个使用IntelliJ的开发人员那里继承一个项目。我无法在项目的pom中使用Eclipse的maven集成:Maven Dependencies库没有显示在类路径中,也没有基于pom配置源文件夹。

我已将问题隔离到以下插件条目中:当我将其注释掉时,Eclipse集成似乎按预期工作。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <!-- 2.8.0-01 and later require maven-compiler-plugin 3.1 or higher -->
    <version>3.1</version>
    <configuration>
        <source>1.7</source>
        <target>1.7</target>
        <compilerId>groovy-eclipse-compiler</compilerId>
        <encoding>UTF-8</encoding>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.2-01</version>
        </dependency>
        <!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.4.3-01</version>
        </dependency>
    </dependencies>
</plugin>

如何解决此问题,以免Eclipse窒息?我是Maven的新手,而且Eclipse的集成似乎很复杂,并且需要大量额外的“生命周期映射”元数据。我尝试忽略上述插件(例如,在<?m2e ignore?>元素as described here之后添加<plugin>处理指令,但这似乎并不能解决问题)。

版本和其他信息

我正在使用:

  • Eclipse 2018.09
  • m2e 1.9.1和m2e-wtp 1.4.0
  • Maven 3.6.0
  • Mac OS X High Sierra 10.13.6

0 个答案:

没有答案
相关问题