此处不允许使用元素 systemPropertyVariables - Intellij IDEA

问题描述

我的 pom 文件中出现上述错误。我可以使用 maven 成功构建项目,但 IntelliJ 给了我以下错误,并在 pom 中以红色显示该部分。

  • 此处不允许使用元素 systemPropertyVariables
  • 无法解析符号“jacoco-agent.destfile”

我尝试使用 this thread 中的解决方案,但对我不起作用。

下面是我在 pom.xml 中的代码片段。有什么帮助吗?

            <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${jacoco-version}</version>
            <executions>
                <execution>
                    <id>PA</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>R</id>
                    <phase>prepare-package</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                </execution>
                <execution>
                    <id>UT</id>
                    <phase>test</phase>
                    <goals>
                        <goal>report</goal>
                    </goals>
                    <configuration>
                        <dataFile>target/jacoco.exec</dataFile>
                        <outputDirectory>target/jacoco-ut</outputDirectory>
                    </configuration>
                </execution>
            </executions>
            <configuration>
                <systemPropertyVariables>
                    <jacoco-agent.destfile>target/jacoco.exec</jacoco-agent.destfile>
                </systemPropertyVariables>
            </configuration>
        </plugin>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)