Fight your technical debt with Jenkins, Jacoco and Sonar
-
Upload
mickael-istria -
Category
Technology
-
view
8.763 -
download
0
description
Transcript of Fight your technical debt with Jenkins, Jacoco and Sonar
![Page 1: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/1.jpg)
Get ready to fightyour technical debt!
Tycho, Sonar and Jacoco
![Page 2: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/2.jpg)
Xavier Seignardwww.podbox.com@xavier_seignard
Mickael IstriaJboss, by Redhat
@mickaelistria
![Page 3: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/3.jpg)
Code quality!The goal:
…StandardsCode CoverageComplexityDesignCommentsDuplicationsTests...
![Page 4: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/4.jpg)
Maintain. Use. Rely.Why is it important?
Understand. Test. Change.Learn. Adapt. Replace.
And so on.
![Page 5: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/5.jpg)
How to analyze it?Problem?
With so many bundles
![Page 6: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/6.jpg)
… reports are scatteredTools are there, but...
checkstyle, pmd, findbugs, etc.
![Page 7: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/7.jpg)
Sonar!
Solution?Unify and aggregate these reports
The last step towards code quality analysis
![Page 8: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/8.jpg)
Hands-on!From a successful Tycho build
![Page 9: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/9.jpg)
Hands-on!Put this build on Jenkins/Hudson
![Page 10: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/10.jpg)
Achievement #1 unlocked!You have a reproducible build!
![Page 11: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/11.jpg)
Hands-on!Put Sonar at work
Install Sonar plugin on Jenkins/Hudon.Configure it. Configure your build.
![Page 12: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/12.jpg)
Hands-on (ad)!Or use Dev@cloud from Cloudbees
Pain free Jenkins and Sonar.No maintenance. Ready to use.And more!
![Page 13: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/13.jpg)
Achievement #2 unlocked!Your tech debt is under control!
![Page 14: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/14.jpg)
The missing piece
Code coverageIs that part of code tested or not?
![Page 15: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/15.jpg)
Jacoco!
So what?On the fly instrumentation
The beloved jacoco agent
![Page 16: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/16.jpg)
Jacoco?As easy as setting an arg to the JVM
-Djavaagent=jacoco.jar=[option1=value1[,optionN=valueN]*]
Maven pluginSets ${tycho.testArgLine} to -Djavaagent=jacoco.jar...Pro tip: Use <appArgLine> to set other JVM args in Tycho Surefire plugin.
![Page 17: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/17.jpg)
Hands-on...
... top level pom
![Page 18: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/18.jpg)
Achievement #3 unlocked!You're ready to fight your tech debt!
![Page 19: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/19.jpg)
ThanksTo Nicolas De loof (@ndeloof) and Cloudbees for providing us a 1st class Dev@cloud instance for this demo.
![Page 20: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/20.jpg)
Resources- The base project we used: http://www.eclipse.org/recommenders/- Jenkins: https://eclipsecon2012.ci.cloudbees.com/- Sonar: https://eclipsecon2012.sonar.cloudbees.com/- The maven profile: https://gist.github.com/2212435
Some bugs you should follow- [email protected]: http://bugs.eclipse.org/360935- Jacoco@jenkins: https://issues.jenkins-ci.org/browse/JENKINS-10835
![Page 21: Fight your technical debt with Jenkins, Jacoco and Sonar](https://reader033.fdocuments.net/reader033/viewer/2022052906/5589e883d8b42ac2378b45e9/html5/thumbnails/21.jpg)
Questions?
Don't forget to give your feedback:
http://www.eclipsecon.org/2012/sessions/get-ready-fight-your-technical-debt-tycho-sonar-and-jacoco