首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用覆盖maven插件生成xml报表?

如何使用覆盖maven插件生成xml报表?
EN

Stack Overflow用户
提问于 2016-04-29 08:11:14
回答 1查看 3.9K关注 0票数 2

我正在尝试生成scoverage报告,以便在Jenkins中使用它。但是我所能得到的只有包含我的.scala文件的文件夹覆盖类。下面是我的pom.xml的一部分:

代码语言:javascript
复制
<build>
        <plugins>
            <plugin>
                <groupId>org.scala-tools</groupId>
                <artifactId>maven-scala-plugin</artifactId>
                <version>2.15.2</version>
                <executions>
                    <execution>
                        <id>scala-compile</id>
                        <goals>
                            <goal>compile</goal>
                            <goal>testCompile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scalatest</groupId>
                <artifactId>scalatest-maven-plugin</artifactId>
                <version>${scalatest.plugin.version}</version>
                <configuration>
                    <junitxml>surefire-reports</junitxml>
                    <stdout>W</stdout>
                </configuration>
                <executions>
                    <execution>
                        <id>test</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>1.1.1</version>
                <configuration>
                    <scalaVersion>${scala.version}</scalaVersion>
                    <aggregate>true</aggregate>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-project-info-reports-plugin</artifactId>
                <version>2.9</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>index</report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>

            <plugin>
                <groupId>org.scoverage</groupId>
                <artifactId>scoverage-maven-plugin</artifactId>
                <version>${scoverage.plugin.version}</version>
                <reportSets>
                    <reportSet>
                        <reports>
                            <report>report
                            </report>
                        </reports>
                    </reportSet>
                </reportSets>
            </plugin>
        </plugins>
    </reporting>

Scalatest生成xml报告,但Scoverage不生成xml报告。我试着用不同的arg运行maven,比如mvn覆盖率:report、mvn覆盖:report等等。什么都帮不上忙。我应该改变什么在我的pom使它工作?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-04-29 10:05:27

原来,我有scala编译器插件,它不受scoverage插件的支持。而且,它看起来像org.scala中的maven scala编译器插件--工具已经过时了。由scoverage插件支持的是:

  • maven:scala plugin
  • com.google.code.sbt-compiler-maven-plugin:sbt-compiler-maven-plugin
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36933024

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档