tag:blogger.com,1999:blog-12971266604539314982024-03-21T00:31:11.810-07:00Jenkins & SonarA Blog for Jenkins(Hudson), Sonar and other CI & SCM ToolsJignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.comBlogger19125tag:blogger.com,1999:blog-1297126660453931498.post-16242318572422763612013-08-09T08:04:00.001-07:002013-08-09T08:04:17.580-07:00How to upgrade Jenkins ?
1. Shutdown Jenkins .2. Take backup of current Jenkins repository3. Download jenkins.war file & put it in current webapps folder of apache tomcat.
4. Restart Jenkins5. Start Sonar & Jenkins
Very easy and straight forward right ??????
Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-7369390087808169992013-08-09T07:58:00.000-07:002013-08-09T07:58:05.313-07:00How to upgrade sonar ?
1. Take backup of current sonar filesystem & DB.2. Unzip sonar351 (Your current sonar version) in /opt/ folder.3. Shutdown Sonar. 4. Update the content of the sonar.properties and wrapper.conf files located in the {$NEW_SONAR_HOME}/conf directory according of the content of the related files in Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-7297647454557702252013-06-06T23:43:00.000-07:002013-06-06T23:46:31.646-07:00Please provide the values of the properties sonar.login and sonar.password Error in sonar
Hi guys,
If you get below error in your sonar build, don't worry we have solution for that.
org.sonar.api.utils.SonarException: Not authorized.
Analyzing this project requires to be authenticated.
Please provide the values of the properties sonar.login and sonar.password.
at org.sonar.batch.bootstrap.ServerClient.handleHttpException(ServerClient.java:106)
at Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-26143231197218720212013-06-06T23:42:00.001-07:002013-06-06T23:42:11.354-07:00Beauty of Mask Password Plugin in Jenkins
Hi Friends,
If you know when we build any project through jenkins, it shows console where we can see deployment log.
So if you are passing any secure information in build information like user name and password and if you want to secure that information which masked passwords and other information, There is one jenkins plugin available by using that you can mask any secure information.
Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-11236990180954485892012-12-27T21:50:00.000-08:002012-12-28T03:06:55.573-08:00Know about java code coverage plugins : sonar
The default Java code coverage engine for unit tests to be used must
be defined in
Settings > Configuration > General Settings >
Java > Code coverage plugin property.
By default the Java code coverage engine with come up with sonar is JaCoCo but Cobertura, Emma or Clover can also be used.
JaCoCo
JaCoCo is an open source and robust Java code coverage tool.Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-63030999175513964902012-12-27T04:11:00.001-08:002012-12-27T04:11:31.240-08:00No relationship between generic parameter and method argument
Hi All,
If you are usinf findbugs to check code quality,
you may see violations like "No relationship between generic parameter and method argument".
Since Map.get() is not fully generic, we often find cases where a
developer passed a different type of object (and hence bugs). Frequency
of such cases went up when we started using artifacts/services from
other teams. What are the reasons whyJignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-49172193156352958352012-12-27T01:53:00.004-08:002012-12-28T03:11:23.087-08:00jacoco code coverage with Ant - Sonar
Here is the detail for how to setup code coverage using jacoco plugin which is OOB come out with SONAR :
Write sample java project called ant-jacoco-codecoverage
Project folder structure would be given as below snapshot:
Under the target folder you may have to create classes & reports folders where reports folder will have one more folder called junit
Write sample Java class Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com1tag:blogger.com,1999:blog-1297126660453931498.post-35565269639462307252012-12-13T03:21:00.001-08:002012-12-13T03:36:42.860-08:00What is LCOM4 ?
Hi Everybody,
If you want to know about the LCOM4(Lack of Cohesion of Methods) which sonar having , please see below example:
Cohesion is the degree to which the methods of a single class are tight
together. When two methods in a class do not use a common attribute or a
common method, it means that they share nothing and should probably not
belong to the same class to respect the Single Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-21514699396854340522012-12-05T21:51:00.001-08:002012-12-05T22:04:42.701-08:00Malicious code vulnerability - May expose internal representation by returning reference to mutable object
Hi Everyone,
Normally this kind of violations comes when you are using mutable object in getter settter.
Ideally you should not direct return mutable object, instead you can return clone of that mutable object.
If you see this violation in your code , you can use below code for your mutable object :
If you are using Date :
public class DateTest {
private Date date;
 Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com1tag:blogger.com,1999:blog-1297126660453931498.post-79631555057531875862012-07-26T02:49:00.000-07:002012-07-26T02:49:16.058-07:00Switchoff plugin for sonarGuys
Have you ever been tried to use switch off plugin of sonar ?
This plugin is really helpful when you switch-off any specific violation from the specific line or specific files.
I really liked this plugin.
See below details to get it installed :
1) Start sonar and login with admin credentials
2) Go Configuration >> Update Center and click on Available plugins tab and install LDAP Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-13931527519529200222012-07-25T23:21:00.001-07:002012-07-25T23:23:35.546-07:00LDAP integration with SonarIf you want to integrate LDAP directory server with sonar, you can follow below steps.
Its very easy and useful for sonar security:
1) First start your Sonar and login with admin credentials.
2) Go Configuration >> Update Center and click on Available plugins and install LDAP plugin
3) Now stop your sonar server
4) open sonar.properties file and append below code
sonar.authenticator.classJignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-63972040593913849302012-06-04T06:35:00.000-07:002012-06-04T06:35:13.567-07:00Jenkins master - slave configurationIf you are new with Jenkins and want to know how to configure slave server with Jenkins master ,
Here are the steps to follow to configure slave server(Linux,Windows and JNLP):
For Linux :
1) Setup Jenkins server in your local machine as steps mentioned in http://sonar-jenkins.blogspot.in/2012/05/setup-jenkins-in-local-machine.html
2) Now go to Manage Jenkins >> Manage Nodes
3) Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com2tag:blogger.com,1999:blog-1297126660453931498.post-90041736576151227252012-05-24T05:46:00.001-07:002012-05-24T05:46:41.857-07:00Sonar Integration with Jenkins
Stay tuned for more information !!!!!Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-33029500718451756822012-05-24T00:34:00.005-07:002012-06-04T06:37:46.461-07:00LDAP integration with JenkinsIf you want to integrate LDAP plugin with Jenkins and make your jenkins application LDAP secure,
You can follow below steps to configure LDAP with Jenkins :
1) Go To Manage Jenkins >> Configure System
2) Configure LDAP related stuff as show below
Note : Make Sure all configuration related to LDAP should be proper.
3) Save all data and try to login with your LDAP credentials.
Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com1tag:blogger.com,1999:blog-1297126660453931498.post-30190021751036331022012-05-23T05:14:00.003-07:002012-05-24T01:55:24.895-07:00Build Maven project with JenkinsHi Everyone,
Here are the steps to configure maven based project in Jenkins.
Hope this will be useful to make build automation with maven based project
1) Install Jenkins in local machine as per the steps given in last blog post.
2) Go to Manage Jenkins>> Configure System
3) Set Maven path as show in below screenshot
5)Now create new job to build maven based project
6) Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-49792423502009058862012-05-21T23:25:00.004-07:002012-05-24T01:55:41.268-07:00Setup Jenkins in local machine
Steps to install jenkins in local machine
Install apache tomcat server
Download latest jenkins war file from http://jenkins-ci.org/
Deploy jenkins.war file in tomcat webapps folder
Once jenkins.war deployed successfully, start the tomcat server
Open http://localhost:8080/jenkins in browser once server starts properly
Now configure JDK and ANT which can be used to build the project.For Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com5tag:blogger.com,1999:blog-1297126660453931498.post-78182069062254979062012-03-19T01:21:00.002-07:002012-05-24T01:55:54.339-07:00hudson.util.IOException2 error in jenkins buildIf you found below error when you build project from jenkins then you can remove <your project>.log file from
/opt/jenkins/workspace location
hudson.util.IOException2: remote file operation failed: /opt/hudson/workspace/vwr-connect at hudson.remoting.Channel@5c784d:alfrescoadvanstarqa1.cignex.com
at hudson.FilePath.act(FilePath.java:754)
at hudson.FilePath.act(Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-38725356997789951312012-02-22T02:07:00.003-08:002012-05-24T01:56:06.287-07:00Hudson SVN authentication failedThe Hudson was building all projects without any issues since it was installed. All of a sudden yesterday my inbox was filled with failure reports, Hudson was not able to build any of the projects. Logs were having stacktrace like mentioned below-
ERROR: svn: authentication cancelled
org.tmatesoft.svn.core.SVNCancelException: svn: authentication cancelled
at Jignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0tag:blogger.com,1999:blog-1297126660453931498.post-85866534973071257592012-02-16T00:02:00.001-08:002012-02-16T00:02:09.034-08:00WelcomeYou will find all the infomation related to sonar and jenkinsJignesh Vachhanihttp://www.blogger.com/profile/18040117955302228816noreply@blogger.com0