这里不允许如何忽略Element错误

时间:2019-01-03 11:20:19

标签: maven intellij-idea

我总是遇到一个问题,警告我的maven POM文件中不允许以下代码。 (过去使用Eclipse时没有问题)。 但是我仍然可以使用Intellij 2017版本进行编译和运行而不会出现问题。

我最近移至版本2018。收到相同的警告,但不再能够编译。 (如果我注释掉,可以编译)。

在Intellij上是否可以解决此问题?这是旧版代码,我不想删除它。

错误消息:

Element compilerArgs is not allowed here.
Element forkCount is not allowed here.

POM文件。有问题的评论零件。

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <compilerArgs> <!-- ERROR -->
            <arg>-XX:MaxPermSize=256m</arg>
        </compilerArgs>
    </configuration>
</plugin>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <configuration>
        <forkCount>1</forkCount> <!-- ERROR -->
        <argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
    </configuration>
</plugin>

0 个答案:

没有答案