mvn sonar:sonar是做什么的? [英] What does mvn sonar:sonar do?

查看:449
本文介绍了mvn sonar:sonar是做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

命令mvn sonar:sonar执行的Maven生命周期阶段是什么?

What are the maven lifecycle phases does the command mvn sonar:sonar execute?

当我看到在屏幕上运行的日志时,发现了很高的test, install级别.

While I see the logs that run over the screen, at a very high level test, install that I spotted out.

考虑以下示例,

我有一个如下的Maven项目

I have a maven project like the following

maven-root

 maven-child-1

 maven-child-2

考虑以下情况,我已经在根级别上按顺序完成了

Consider the following scenario, I have done them sequentially at root level

  1. mvn clean install
  2. mvn sonar:sonar-查看报告
  3. 通过添加一些测试用例以增加代码覆盖率来修改child-2
  4. 运行mvn sonar:sonar
  1. mvn clean install
  2. mvn sonar:sonar -- See the report
  3. Modified child-2 by adding some test cases to increase the code coverage
  4. Run mvn sonar:sonar

我对测试用例的更改未反映在报告中.

My changes for the test cases are not reflecting in the report.

  1. 我已从声纳尔贝删除了该报告
  2. mvn sonar:sonar

仍然可以生成旧报告.

简而言之,我需要先执行mvn clean install然后执行mvn sonar:sonar吗?

In brief, Do I need to perform mvn clean install and then mvn sonar:sonar ?

如果mvn sonar:sonar涵盖了执行mvn clean install的原因,为什么报告会给我旧的数字?

If mvn sonar:sonar covers executing the mvn clean install, why the report gives me old numbers?

推荐答案

mvn sonar:sonar不会触发mvn clean install执行.它仅触发Maven Surefire插件执行.

mvn sonar:sonar does not trigger a mvn clean install execution. It triggers a Maven Surefire plugin execution only.

这就是为什么您需要在每次分析之前执行mvn clean install的原因-否则您编译的类不会是最新的,因此Surefire执行将不包括最新的修改.

This is why you need to perform a mvn clean install before each analysis - otherwise your compiled classes won't be up-to-date and therefore the Surefire execution won't include recent modifications.

这篇关于mvn sonar:sonar是做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆