一、首先下载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. VS2017新建或拷贝项目编译时出现:找不到 Windows SDK 版本8.1.请安装所需的版本的 Windows SDK

    VS2017新建或拷贝项目编译时出现:找不到 Windows SDK 版本8.1.请安装所需的版本的 Windows SDK 或者在项目属性页的问题解决方案 解决方法: 右击项目解决方案, 选择:重定 ...

  2. Linux按文件名搜索命令

    find 搜索目录 -name 目标名字 find / -name file名 /代表是全盘搜索,也可以指定目录搜索 find 搜索文件的命令格式: find [搜索范围] [匹配条件] 选项: -n ...

  3. htm5实现 文件夹上传

    观察百度云上传,可以看到input type=file 的标签上加个一个属性“webkitdirectory”,加上次属性即可选择整个文件夹.

  4. UVa 400 Unix Is命令

    简单题 #include <bits/stdc++.h> using namespace std; const int maxn=110; string s[maxn]; int main ...

  5. toSum

    Given an array of integers, return indices of the two numbers such that they add up to a specific ta ...

  6. python换源

    pip源的更新 引用自:PyPI使用国内源 # coding: utf-8 import platform import os os_type = platform.system() if " ...

  7. python--小游戏(循环+随机)

    1 import time 2 import random 3 4 player_victory = 0 5 enemy_victory = 0 6 a1 = True 7 while a1: 8 f ...

  8. java 责任链模式的三种实现

    责任链模式 责任链模式的定义:使多个对象都有机会处理请求,从而避免请求的发送者和接受者之间的耦合关系, 将这个对象连成一条链,并沿着这条链传递该请求,直到有一个对象处理他为止.这里就不再过多的介绍什么 ...

  9. 【代码审计】XDCMS 报错注入

    审计的都是之前很老的一些的CMS,把学习的过程分享出来,如果有正在和我一起学习的兄弟们,希望看到文章之后会有所收获 ------------------------------------------ ...

  10. iOS 上通过 802.11k、802.11r 和 802.11v 实现 Wi-Fi 网络漫游

    在 iOS 上通过 802.11k.802.11r 和 802.11v 实现 Wi-Fi 网络漫游 了解 iOS 如何使用 Wi-Fi 网络标准提升客户端漫游性能. iOS 支持在企业级 Wi-Fi ...