一、首先下载sonarqube   地址 : https://www.sonarqube.org/downloads/   (最新版本支持java11+,博主下载支持java8的版本7.7),

    下载SonarScanner   地址:https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/

需要注意的是该版本对应的是mysql5.7,不能是mysql8

二、windows 安装

  mysql5.7安装好创建sonar数据库

  解压下载好的sonarQube7.7

配置conf中的sonar.properties

##数据库配置

  sonar.jdbc.username=root

  sonar.jdbc.password=********

  sonar.jdbc.url=jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true&useConfigs=maxPerformance&useSSL=false

  ## 下面设定访问网址为 http://localhost:9000

  sonar.web.host=0.0.0.0

  sonar.web.port=9000

  sonar.web.context=xxxx

启动、打开sonar/bin,进入相对应系统的文件夹下,重启服务:StartSonar.bat

  由于要进行数据库初始化,所以这次会有点慢。(如果不成功,请查看数据库是否成功创建并具有相应的权限)

启动成功如下:

输入localhost:9000登陆,用户名密码都是admin

汉化包地址:https://github.com/SonarQubeCommunity/sonar-l10n-zh,直接下载对应版本

将下载的汉化包放入sonarqube-7.7\extensions\plugins目录下,重启服务

三、项目中的使用

安装sonarScanner,注意windows和linux是不同的,在对应环境用对应包

需要配置好sonarScanner

打开要进行代码分析的项目根目录,新建sonar-project.properties文件

sonar-project.properties内容如下:

# must be unique in a given SonarQube instance
#projectName是项目名称
sonar.projectKey=项目名称 # this is the name displayed in the SonarQube UI sonar.projectName=hnsi-calc-ybjs-service sonar.projectVersion=1.0 # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Since SonarQube 4.2, this property is optional if sonar.modules is set. # If not set, SonarQube starts looking for source code from the directory containing # the sonar-project.properties file.
#sources是源文件所在的目录
sonar.sources=src
#binaries是class文件所在的目录
sonar.java.binaries=target sonar.language=java # Encoding of the source code. Default is default system encoding sonar.sourceEncoding=UTF-8

启动sonarqube服务。

并启动cmd,在cmd进入项目所在的根目录,输入命令:sonar-scanner进行分析,

分析成功后

查看web浏览器

点开

四、与maven的结合使用

可以参考官网描述https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/

需要setting.xml的配置及插件

setting.xml配置,添加

<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://localhost:9000</sonar.host.url>
<sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>root</sonar.jdbc.username>
<sonar.jdbc.password>123456</sonar.jdbc.password>
</properties>
</profile>

完整配置如下:

<?xml version="1.0" encoding="UTF-8"?>

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>G:/sharp/repo</localRepository>
<servers>
<server>
<id>nexus-snapshots</id>
<username>xxx</username>
<password>xxx</password>
</server>
</servers> <mirrors> </mirrors> <profiles>
<profile>
<repositories>
<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories> <pluginRepositories>
<pluginRepository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo.maven.apache.org/maven2</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
<releases>
<updatePolicy>never</updatePolicy>
</releases>
</pluginRepository>
</pluginRepositories> </profile> <profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>http://localhost:9000</sonar.host.url>
<sonar.jdbc.url>jdbc:mysql://localhost:3306/sonar</sonar.jdbc.url>
<sonar.jdbc.driver>com.mysql.jdbc.Driver</sonar.jdbc.driver>
<sonar.jdbc.username>root</sonar.jdbc.username>
<sonar.jdbc.password>123456</sonar.jdbc.password>
</properties>
</profile> </profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles> </settings>

pom中添加对应版本的sonar插件

  <plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.6.0.1398</version>
</plugin>

本次实验是在common项目下进行

idea中采用命令方式打包:mvn clean install sonar:sonar

如下:

 Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 G:\drawnblue\springcloud-alibaba\common>mvn clean install sonar:sonar
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building common 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ common ---
[INFO] Deleting G:\drawnblue\springcloud-alibaba\common\target
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 5 source files to G:\drawnblue\springcloud-alibaba\common\target\classes
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory G:\drawnblue\springcloud-alibaba\common\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ common ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to G:\drawnblue\springcloud-alibaba\common\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ common ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.drawnblue.common.CommonApplicationTests
14:32:26.305 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.drawnblue.common.CommonApplicationTests]
14:32:26.310 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
14:32:26.316 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springfram
ework.test.context.CacheAwareContextLoaderDelegate)]
14:32:26.334 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.drawnblue.common.CommonApplicationTests] from class [org.springframework.boot.test.context.Spr
ingBootTestContextBootstrapper]
14:32:26.345 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.drawnblue.common.CommonApplicationTests], using Spr
ingBootContextLoader
14:32:26.348 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.drawnblue.common.CommonApplicationTests]: class path resource [com/drawnblue
/common/CommonApplicationTests-context.xml] does not exist
14:32:26.348 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.drawnblue.common.CommonApplicationTests]: class path resource [com/drawnblue
/common/CommonApplicationTestsContext.groovy] does not exist
14:32:26.349 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.drawnblue.common.CommonApplicationTests]: no resource found for suffixes {
-context.xml, Context.groovy}.
14:32:26.350 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.drawnblue.common.CommonApplicationTests]: CommonApplicatio
nTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
14:32:26.388 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.drawnbl
ue.common.CommonApplicationTests]
14:32:26.450 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [G:\drawnblue\springcloud-alibaba\common\target\classes\com\drawnblue\comm
on\CommonApplication.class]
14:32:26.452 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.drawnblue.common.CommonApplication for test class com.drawnblue.common.CommonApplicationTests
14:32:26.522 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.drawnblue.common.CommonApplicationTests]: using defaults.
14:32:26.523 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.m
ockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.a
utoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.ser
vlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.su
pport.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.t
est.context.jdbc.SqlScriptsTestExecutionListener]
14:32:26.529 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener] due to a missing de
pendency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [javax/servlet/ServletContext]
14:32:26.531 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.transaction.TransactionalTestExecutionListener] due t
o a missing dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/interceptor/TransactionAttributeSource]
14:32:26.531 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Skipping candidate TestExecutionListener [org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] due to a missin
g dependency. Specify custom listener classes or make the default listener classes and their required dependencies available. Offending class: [org/springframework/transaction/interceptor/TransactionAttribute]
14:32:26.531 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@795cd85e,
org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@59fd97a8, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@f5ac9e4, org.springframework.test.context.support.D
irtiesContextTestExecutionListener@123ef382, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@dbf57b3, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@384ad17b, org.sp
ringframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@61862a7f, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@441772e, org.sprin
gframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@7334aada]
14:32:26.533 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.drawnblue.common.CommonApplicationTests]
14:32:26.533 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.drawnblue.common.CommonAppli
cationTests]
14:32:26.534 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.drawnblue.common.CommonApplicationTests]
14:32:26.534 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.drawnblue.common.CommonAppli
cationTests]
14:32:26.535 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.drawnblue.common.CommonApplicationTests]
14:32:26.535 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.drawnblue.common.CommonAppli
cationTests]
14:32:26.538 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@4466af20 testClass = CommonApplicationTests, testInstance = [null],
testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@a514af7 testClass = CommonApplicationTests, locations = '{}', classes = '{class com.drawnblue.common.CommonApplication}', cont
extInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.sprin
gframework.boot.test.context.filter.ExcludeFilterContextCustomizer@1a1d6a08, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@436e852b, org.springframework.boot.
test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@670b40af, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.sp
ringframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@612679d6], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map[[empty
]]], class annotated with @DirtiesContext [false] with mode [null].
14:32:26.539 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.drawnblue.common.CommonApplicationTests]
14:32:26.539 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.drawnblue.common.CommonAppli
cationTests]
14:32:26.542 [main] DEBUG org.springframework.test.context.support.DependencyInjectionTestExecutionListener - Performing dependency injection for test context [[DefaultTestContext@4466af20 testClass = CommonApplicationTests, tes
tInstance = com.drawnblue.common.CommonApplicationTests@dd8ba08, testMethod = [null], testException = [null], mergedContextConfiguration = [MergedContextConfiguration@a514af7 testClass = CommonApplicationTests, locations = '{}',
classes = '{class com.drawnblue.common.CommonApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootT
estContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@1a1d6a08, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$Duplica
teJsonObjectContextCustomizer@436e852b, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@670b40af, org.springframework.boot.test.au
toconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@612679d6], contextLoader = 'org.springframework.boot.test.context.Sp
ringBootContextLoader', parent = [null]], attributes = map[[empty]]]].
14:32:26.559 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstr
apper=true, server.port=-1} . ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.1.6.RELEASE) 2019-09-27 14:32:26.726 INFO 4852 --- [ main] c.d.common.CommonApplicationTests : Starting CommonApplicationTests on hh-PC with PID 4852 (started by Administrator in G:\drawnblue\springcloud-alibaba\common)
2019-09-27 14:32:26.727 INFO 4852 --- [ main] c.d.common.CommonApplicationTests : No active profile set, falling back to default profiles: default
2019-09-27 14:32:27.066 INFO 4852 --- [ main] c.d.common.CommonApplicationTests : Started CommonApplicationTests in 0.506 seconds (JVM running for 1.1)
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.999 s - in com.drawnblue.common.CommonApplicationTests
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
[INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ common ---
[INFO] Building jar: G:\drawnblue\springcloud-alibaba\common\target\common-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) @ common ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- maven-install-plugin:2.5.2:install (default-install) @ common ---
[INFO] Installing G:\drawnblue\springcloud-alibaba\common\target\common-0.0.1-SNAPSHOT.jar to C:\Users\Administrator\.m2\repository\com\drawnblue\common\0.0.1-SNAPSHOT\common-0.0.1-SNAPSHOT.jar
[INFO] Installing G:\drawnblue\springcloud-alibaba\common\pom.xml to C:\Users\Administrator\.m2\repository\com\drawnblue\common\0.0.1-SNAPSHOT\common-0.0.1-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building common 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- sonar-maven-plugin:3.6.0.1398:sonar (default-cli) @ common ---
[INFO] User cache: C:\Users\Administrator\.sonar\cache
[INFO] SonarQube version: 7.7.0
[INFO] Default locale: "zh_CN", source code encoding: "UTF-8"
[INFO] Load global settings
[INFO] Load global settings (done) | time=94ms
[INFO] Server id: 49B321BC-AW1wY6hGXgbphgfNsIsZ
[INFO] User cache: C:\Users\Administrator\.sonar\cache
[INFO] Load/download plugins
[INFO] Load plugins index
[INFO] Load plugins index (done) | time=42ms
[INFO] Plugin [l10nzh] defines 'l10nen' as base plugin. This metadata can be removed from manifest of l10n plugins since version 5.2.
[INFO] Load/download plugins (done) | time=64ms
[INFO] Process project properties
[INFO] Execute project builders
[INFO] Execute project builders (done) | time=3ms
[INFO] Project key: com.drawnblue:common
[INFO] Base dir: G:\drawnblue\springcloud-alibaba\common
[INFO] Working dir: G:\drawnblue\springcloud-alibaba\common\target\sonar
[INFO] Load project settings for component key: 'com.drawnblue:common'
[INFO] Load project settings for component key: 'com.drawnblue:common' (done) | time=49ms
[INFO] Load project repositories
[INFO] Load project repositories (done) | time=80ms
[INFO] Load quality profiles
[INFO] Load quality profiles (done) | time=29ms
[INFO] Load active rules
[INFO] Load active rules (done) | time=423ms
[WARNING] SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
[INFO] Indexing files...
[INFO] Project configuration:
[INFO] 7 files indexed
[INFO] Quality profile for java: Sonar way
[INFO] Quality profile for xml: Sonar way
[INFO] ------------- Run sensors on module common
[INFO] Load metrics repository
[INFO] Load metrics repository (done) | time=17ms
[INFO] Sensor JavaSquidSensor [java]
[INFO] Configured Java source version (sonar.java.source): 8
[INFO] JavaClasspath initialization
[INFO] JavaClasspath initialization (done) | time=11ms
[INFO] JavaTestClasspath initialization
[INFO] JavaTestClasspath initialization (done) | time=3ms
[INFO] Java Main Files AST scan
[INFO] 5 source files to be analyzed
[INFO] 5/5 source files have been analyzed
[WARNING] Classes not found during the analysis : [javax.annotation.meta.When]
[INFO] Java Main Files AST scan (done) | time=693ms
[INFO] Java Test Files AST scan
[INFO] 1 source files to be analyzed
[WARNING] Unable to create a corresponding matcher for custom assertion method, please check the format of the following symbol: ''
[INFO] 1/1 source files have been analyzed
[INFO] Java Test Files AST scan (done) | time=30ms
[INFO] Sensor JavaSquidSensor [java] (done) | time=1182ms
[INFO] Sensor JaCoCo XML Report Importer [jacoco]
[INFO] Sensor JaCoCo XML Report Importer [jacoco] (done) | time=3ms
[INFO] Sensor SurefireSensor [java]
[INFO] parsing [G:\drawnblue\springcloud-alibaba\common\target\surefire-reports]
[INFO] Sensor SurefireSensor [java] (done) | time=26ms
[INFO] Sensor JaCoCoSensor [java]
[INFO] Sensor JaCoCoSensor [java] (done) | time=1ms
[INFO] Sensor JavaXmlSensor [java]
[INFO] 1 source files to be analyzed
[INFO] Sensor JavaXmlSensor [java] (done) | time=112ms
[INFO] Sensor HTML [web]
[INFO] 1/1 source files have been analyzed
[INFO] Sensor HTML [web] (done) | time=12ms
[INFO] Sensor XML Sensor [xml]
[INFO] 1 source files to be analyzed
[INFO] Sensor XML Sensor [xml] (done) | time=106ms
[INFO] 1/1 source files have been analyzed
[INFO] ------------- Run sensors on project
[INFO] Sensor Zero Coverage Sensor
[INFO] Sensor Zero Coverage Sensor (done) | time=11ms
[INFO] Sensor Java CPD Block Indexer
[INFO] Sensor Java CPD Block Indexer (done) | time=19ms
[INFO] No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
[INFO] 2 files had no CPD blocks
[INFO] Calculating CPD for 3 files
[INFO] CPD calculation finished
[INFO] Analysis report generated in 67ms, dir size=105 KB
[INFO] Analysis report compressed in 27ms, zip size=26 KB
[INFO] Analysis report uploaded in 141ms
[INFO] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=com.drawnblue%3Acommon
[INFO] Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
[INFO] More about the report processing at http://localhost:9000/api/ce/task?id=AW1xa8yJFapCHcyRPg9i
[INFO] Analysis total time: 3.960 s
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.655 s
[INFO] Finished at: 2019-09-27T14:32:33+08:00
[INFO] Final Memory: 63M/563M
[INFO] ------------------------------------------------------------------------ G:\drawnblue\springcloud-alibaba\common>

打包成功,查看

common已经分析完成。

windows下代码规范检测工具sonarqube安装与使用,含与maven的结合的更多相关文章

  1. c/c++编码规范(3)--google代码规范检测工具cpplint.py

    cpplint.py是来自google开源项目风格错误检测工具.它是一个python脚本,和google开源项目风格指南一同发布.下载地址:https://github.com/google/styl ...

  2. PHP 代码质量检测工具的安装与使用

    代码统计工具 PHPLOC安装:wget https://phar.phpunit.de/phploc.phar chmod +x phploc.phar sudo mv phploc.phar /u ...

  3. windows下Jmeter压力测试工具的安装

    JMeter是Apache软件基金会的产品,用于对静态的和动态的资源(文件,Servlet,Perl脚本,Java 对象,数据库和查询,FTP服务器等等)的性能进行测试.是一款很方便的测试软件. 系统 ...

  4. Windows下IIS+PHP 5.2的安装与配置

    Windows下IIS+PHP 5.2的安装与配置   Windows下PHP的安装虽然简单,但如果不注意方法,仍然会让你头疼.此外,PHP 5.2版本与之前4.x版本也有一些不同,所以有必要记录一下 ...

  5. 去掉vue 中的代码规范检测(Eslint验证)

    去掉vue 中的代码规范检测(Eslint验证): 1.在搭建vue脚手架时提示是否启用eslint检测的. Use ESLint to lint your code? 写 no; 2.如果项目已经生 ...

  6. Android ROM开发(一)——Windows下Cygwin和Android_Kitchen厨房的安装

    Android ROM开发(一)--Windows下Cygwin和Android_Kitchen厨房的安装 很久没有碰到ROM开发了,在很久很久以前也是从ROM起步的,无奈还是一脚踏上了Android ...

  7. 全网最全的Windows下Anaconda2 / Anaconda3里正确下载安装爬虫框架Scrapy(离线方式和在线方式)(图文详解)

    不多说,直接上干货! 参考博客 全网最全的Windows下Anaconda2 / Anaconda3里正确下载安装OpenCV(离线方式和在线方式)(图文详解) 第一步:首先,提示升级下pip 第二步 ...

  8. 全网最全的Windows下Python2 / Python3里正确下载安装用来向微信好友发送消息的itchat库(图文详解)

    不多说,直接上干货! 建议,你用Anaconda2或Anaconda3. 见 全网最全的Windows下Anaconda2 / Anaconda3里正确下载安装用来向微信好友发送消息的itchat库( ...

  9. 【调试】Linux下超强内存检测工具Valgrind

    [调试]Linux下超强内存检测工具Valgrind 内容简介 Valgrind是什么? Valgrind的使用 Valgrind详细教程 1. Valgrind是什么? Valgrind是一套Lin ...

随机推荐

  1. CSS3的一个伪类选择器:nth-child()

    CSS3的一个伪类选择器“:nth-child()”. Table表格奇偶数行定义样式: 语法: :nth-child(an+b) 为什么选择她,因为我认为,这个选择器是最多学问的一个了.很可惜,据我 ...

  2. Groovy脚本-通用SQL开关

    备注:使用Groovy语言进行编写,看不懂的同学请先了解Groovy脚本. Groovy学习地址:https://www.cnblogs.com/tiechui2015/p/10828457.html ...

  3. "exit"未定义标签 问题

    找了两个多小时,最后才发现是版本问题.因为是网上下的代码,可能用的版本比较高,而我自己的是2.4.10版本的opencv,所以正确的代码应该是如下: CV_Error(CV_StsBadArg,&qu ...

  4. IIS-代理

    http://192.168.11.3:8083/java   访问  http://192.168.11.3:8089 http://192.168.11.3:8083/?id=1 访问http:/ ...

  5. tensorflow 学习记录

    函数变动 tf.train.SummaryWriter 变为 tf.summary.Filewritter 函数功能相同,仅仅是简单的重命名 ``` writer = tf.summary.FileW ...

  6. SpringCloud全家桶学习之一阶段总结(一)

    一.概述 前几篇小博客记录了我学习SpringCloud组件的过程,并与工作中所用的Dubbo框架做了一点比较,基本组件:Eureka.Ribbon.Hystrix.Feign.Zuul.Config ...

  7. rapidxml读xml文件

    student.xml文件内容: int readXML(void) { rapidxml::file<> file("student.xml"); rapidxml: ...

  8. Java常用API——Arrays工具类

    介绍:Arrays工具类提供了一些可以直接操作数组的方法,以下是一些常用方法: int binarySearch(type[] a, type key):要求数组a元素升序排列,使用二分法搜索key的 ...

  9. 三天的Python课程

    基础很sb但必须熟练掌握: 第一天就是Python的简单介绍与简单的接触.基本都是概念性的东西,需要知道一个非常便捷的IDE工具:pycharm,以后的编程就靠它了.还有就是%s和%d的格式化输出.运 ...

  10. Java Https双向验证

    CA: Certificate Authority,证书颁发机构 CA证书:证书颁发机构颁发的数字证书 参考资料 CA证书和TLS介绍 HTTPS原理和CA证书申请(满满的干货) 单向 / 双向认证 ...