There are some issues reported for SonarCube 6.7 integration
with Hybris. The recommended version is Sonar 6.4 or less. For Sonar 6.4, there
is no need to build the database. Please follow the below steps to use sonarcube
with Hybris. For the POC, we have used Hybris 6.4.0.2 and sonar 6.4.
Sonar Cube configuration
1.
Download sonar 6.4 and install/unzip.
2.
For the POC, we have used Embedded Database
(default). But multiple database is supported. Access management can also be
implemented. However, for the simplicity purpose, it is not used for the POC
3.
The java properties can be set at the sonar.properties file
(not used in our case). Example of the property is sonar.web.javaOpts=-Xmx512m
-Xms128m -XX:+HeapDumpOnOutOfMemoryError
which can be enabled in the sonar.properties
file under conf folder of the installed
folder.
4.
Start sonarcube using StartSonar.bat present in appropriate directory for windows
server, for linux/mac, use sonar.sh from
appropriate installation directory.
Hybris configuration
1.
Download the ant task jar sonarqube-ant-task-2.5.jar
and put it in config/customize/platform/resources/ant/sonar/lib under
Hybris installation directory
2.
Copy the existing sonar.xml file from <INSTALL_DIR>\hybris\bin\platform\resources\ant to config/customize/platform/resources/ant.
Please keep a backup of existing sonar.xml
file
3.
In the copied sonar.xml,
replace the existing sonarqube-ant-task jar file with the new sonarqube-ant-task-2.5.jar
file . For example, updated lines will look like as below
<taskdef uri="antlib:org.sonar.ant"
resource="org/sonar/ant/antlib.xml">
<classpath>
<path
path="${platformhome}/resources/ant/sonar/lib/sonarqube-ant-task-2.5.jar"
/>
</classpath>
</taskdef>
4.
In the copied sonar.xml,
replace all "sonar.binaries"
with "sonar.java.binaries"
5.
In the copied sonar.xml,
replace all "sonar.libraries"
with "sonar.java.libraries"
6.
Configure your sonar project in the local.properties as below
sonar.language=java
sonar.projectName= HYBRIS SONAR POC
sonar.projectKey= HYBRISSONARPOC
sonar.projectVersion=1.0
7.
To exclude OOTB extension, use below property in
the local.properties
sonar.excludedExtensions=
core,testweb,scripting,paymentstandard,mediaweb,maintenanceweb,deliveryzone,commons,processing,impex,validation,catalog,europe1,platformservices,workflow
8.
Use below property in the local.properties to exclude gensrc/** and jalo/**
folder from scanning for each custom folder
9. sonar.exclusions=gensrc/**,src/de/hybris/platform/jalo/**
10.
From platform folder ( hybris/bin/platform),
execute "ant customize" to
apply above customization.
11.
From platform folder, execute “ant sonar”
12.
Now, new project HYBRIS SONAR POC will be
created in sonar
Reference: https://wiki.hybris.com/display/hybrisALF/Measuring+Code+Quality+with+Sonar
short, concise, correct, excellent!
ReplyDeleteSonarcube And Hybris Integration >>>>> Download Now
ReplyDelete>>>>> Download Full
Sonarcube And Hybris Integration >>>>> Download LINK
>>>>> Download Now
Sonarcube And Hybris Integration >>>>> Download Full
>>>>> Download LINK Sn