【问题标题】:Element "systemPropertyVariables" not allowed here in intellij IDEAintellij IDEA 中不允许使用元素“systemPropertyVariables”
【发布时间】:2018-06-16 01:01:56
【问题描述】:

我在我的 pom.xml 中遇到了错误。我可以使用 maven 成功构建项目,但 intellij 给出了上述错误,并在 pom 中以红色显示该部分。 Bellow是我在pom中的部分。对此有什么想法吗?

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  
  ...
<build>
       <plugins>
          ...
          <plugin>
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-surefire-plugin</artifactId>
             <configuration>
                <systemPropertyVariables>
                   <org.ops4j.pax.url.mvn.localRepository>${settings.localRepository}</org.ops4j.pax.url.mvn.localRepository>
                   <jacoco-agent.destfile>${project.build.directory}/jacoco.exec</jacoco-agent.destfile>
                </systemPropertyVariables>
                <suiteXmlFiles>
                   <suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
                </suiteXmlFiles>
             </configuration>
          </plugin>
         ...
       </plugins>
    </build>

【问题讨论】:

  • 您使用哪个 maven 和 idea 版本?你在idea和shell中使用相同的maven版本吗?您是否检查了在这两种环境中使用的surefire 版本?
  • 想法 14 和 maven 3.0.5。是的,都是一样的。我只安装了一个实例。
  • Idea 2016.2 存在同样的问题。 @JayangaKaushalya 你有没有想过这个?
  • 你有没有解决这个问题?

标签: java maven intellij-idea


【解决方案1】:

我怀疑任何发现此问题的人的问题是 IntelliJ 附带了一个捆绑版本的 maven,并且除非您要求它,否则实际上并没有使用您的本地安装。 IntelliJ -> Bundled Maven -> Surefire 的版本链导致它认识到这是一个问题。

有两种方法可以解决这个问题:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-07-31
    • 1970-01-01
    • 1970-01-01
    • 2017-09-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多