【问题标题】:How to fix POM Error destFile not allowed?如何修复 POM 错误 destFile 不允许?
【发布时间】:2020-11-04 05:49:18
【问题描述】:

我正试图让我的团队从 STS 切换到 IntelliJ,但我在 POM 文件中遇到了这个我们在 STS 中看不到的错误。

下面的行抛出错误:“Element destFile is not allowed here” 这不会破坏任何东西,但我只是想确保没有错误。

                    <destFile>${jacoco.exec.path}</destFile>

我该如何解决这个错误?

            <plugin>
                <groupId>org.jacoco</groupId>
                <artifactId>jacoco-maven-plugin</artifactId>
                <version>${jacoco.maven.plugin.version}</version>
                <configuration>
                    <excludes>
                        <exclude>**/*DTO.*</exclude>
                        <exclude>**/*Example.*</exclude>
                        <exclude>**/generated/**/*.*</exclude>
                        <exclude>**/constants/**/*.*</exclude>
                        <exclude>**/dto/**/*.*</exclude>
                        <exclude>**/mapper/**/*.*</exclude>
                        <exclude>**/model/**/*.*</exclude>
                        <exclude>**/domain/**/*.*</exclude>
                        <exclude>**/*.set*</exclude>
                        <exclude>**/*.get*</exclude>
                        <exclude>**/*.toString*</exclude>
                    </excludes>
                    <destFile>${jacoco.exec.path}</destFile>
                    <dataFile>${jacoco.exec.path}</dataFile>
                </configuration>
                <executions>
                    <execution>
                        <id>jacoco-initialize</id>
                        <goals>
                            <goal>prepare-agent</goal>
                        </goals>
                        <configuration>
                            <destFile>target/coverage-reports/jacoco.exec</destFile>
                        </configuration>
                    </execution>
                    <execution>
                        <id>jacoco-site</id>
                        <phase>package</phase>
                        <goals>
                            <goal>report</goal>
                        </goals>
                        <configuration>
                            <destFile>target/coverage-reports/jacoco.exec</destFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

【问题讨论】:

    标签: maven intellij-idea pom.xml


    【解决方案1】:

    不清楚你使用的是什么版本的jacoco-maven-plugin,但是貌似不支持这个配置。更新插件到0.8.5版本seems to fix it

    【讨论】:

    猜你喜欢
    • 2021-05-06
    • 1970-01-01
    • 2021-08-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多