gpt4 book ai didi

java - 如何解决 ElementcompilerArgs is not allowed here Maven 编译器插件错误?

转载 作者:行者123 更新时间:2023-12-01 17:53:39 26 4
gpt4 key购买 nike

我正在使用 Maven 编译器插件 3.0,但收到错误“此处不允许使用 Element compilerArgs”。这似乎适用于命令行,但我在 IDE 中收到此错误。我使用 IDEA 2017.2 社区版。某处可能缺少某些模式,但我不确定。有没有人有一个好的方法来解决这样的问题,而不是向 JetBrains 发送错误报告并等待修复?

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<fork>true</fork>
<compilerArgs>
<arg>-DspecificArg</arg>
</compilerArgs>
</configuration>
</plugin>

最佳答案

我建议你尝试maven-compiler-plugin版本3.7.0。

如果您继续使用版本 3.0,请更新您的设置,使其看起来像以下示例:http://maven.apache.org/plugins-archives/maven-compiler-plugin-3.0/examples/pass-compiler-arguments.html

如果您可以升级到 3.7.0,请看一下这个示例(与您的代码非常相似): https://maven.apache.org/plugins/maven-compiler-plugin/examples/pass-compiler-arguments.html#

关于java - 如何解决 ElementcompilerArgs is not allowed here Maven 编译器插件错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47346038/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com