【问题标题】:Element Classpath not allowed here in IntellijIntellij 中不允许元素类路径
【发布时间】:2016-07-31 23:25:30
【问题描述】:

我的 pom.xml 中有以下配置。带有这个 pom.xml 的项目在 Eclipse 中构建良好,并且当我运行 mvn install 时,mvn compile 从命令行。但仅在 intellij IDEA 中显示错误为“此处不允许元素类路径”

<configuration>
<includeProjectDependencies>true</includeProjectDependencies>
<includePluginDependencies>true</includePluginDependencies>
<classpath />
<mainClass>com.example.check.bts.executor.Starter</mainClass>
</configuration>

如果有人能建议如何解决 Intellij IDEA 上的此错误,将会很有帮助

【问题讨论】:

    标签: java maven intellij-idea classpath


    【解决方案1】:

    经过一番搜索,我开始假设您正在使用 exec-maven-plugin。然后我阅读了示例示例 here 并看到你不应该在那里有 &lt;classpath /&gt;,因此 IntelliJ 会给你这个错误。

    【讨论】:

    • 好的。仍然不清楚为什么 eclipse 中没有错误或从命令行运行时出现任何故障
    • @Raj 我认为他们可能只是忽略了它,但 IntelliJ 很挑剔。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-05-17
    • 1970-01-01
    • 2018-10-08
    • 2012-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多