{"id":21275,"date":"2016-09-05T06:41:01","date_gmt":"2016-09-05T10:41:01","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/?p=21275"},"modified":"2019-02-14T15:56:21","modified_gmt":"2019-02-14T23:56:21","slug":"gradle-build-task-supports-checkstyle-analysis","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/gradle-build-task-supports-checkstyle-analysis\/","title":{"rendered":"Maven and Gradle build task support Checkstyle analysis"},"content":{"rendered":"<p>A few sprints\u00a0ago we enabled <a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2016\/06\/15\/the-gradle-build-task-now-supports-sonarqube-analysis\/\">SonarQube<\/a>\u00a0and <a href=\"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2016\/07\/29\/gradle-build-task-now-also-supports-pmd-analysis\/\">PMD<\/a>\u00a0analysis on the Maven and Gradle tasks. We continue to add code analysis tooling to the Java build tasks with Checkstyle support for Gradle, and &#8211; in a few days &#8211; for Maven.<\/p>\n<p><strong>Checkstyle Analysis <\/strong><\/p>\n<p><a href=\"http:\/\/checkstyle.sourceforge.net\/\">Checkstyle <\/a>is the analyzer of choice for enforcing a coding standard. It is a highly <span>configurable analyzer, but\u00a0you can\u00a0get going fast and use the &#8220;<a href=\"https:\/\/raw.githubusercontent.com\/checkstyle\/checkstyle\/checkstyle-6.1.1\/sun_checks.xml\">Java Sun Checks<\/a>&#8221; by enabling\u00a0the &#8220;Run Checkstyle&#8221; box available in the Code Analysis section.\u00a0<\/span><\/p>\n<p>The build summary then reports the number of issues found by Checkstyle. Detailed issue logs are available under the build Artifact tab of the build summary.<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/05\/110.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2016\/09\/110.png\" alt=\"Enable Checkstyle analysis in the Gradle task\" width=\"446\" height=\"446\" class=\"size-full wp-image-21277\" \/><\/a><\/p>\n<h4><\/h4>\n<p><strong>Customizing Checkstyle<\/strong><\/p>\n<p>If you wish to configure the analysis have a look at the official documentation on\u00a0<a href=\"https:\/\/docs.gradle.org\/current\/userguide\/checkstyle_plugin.html\">applying the Checkstyle\u00a0plugin in the Gradle build<\/a>\u00a0or <a href=\"https:\/\/maven.apache.org\/plugins\/maven-checkstyle-plugin\/\">applying Checkstyle for Maven.\u00a0<\/a>We will detect that you apply the plugin and we will not intervene, but we will try to find the reports and produce a build summary.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Feedback<\/strong><\/p>\n<p><span>We\u2019d like to hear from you. Please raise issues and suggestions on the issues tab of the VSTS task repository in GitHub:\u00a0<\/span><a href=\"https:\/\/github.com\/microsoft\/vsts-tasks\/issues\">https:\/\/github.com\/microsoft\/vsts-tasks\/issues<\/a>\u00a0and add the label &#8220;Area: Analysis&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few sprints\u00a0ago we enabled SonarQube\u00a0and PMD\u00a0analysis on the Maven and Gradle tasks. We continue to add code analysis tooling to the Java build tasks with Checkstyle support for Gradle, and &#8211; in a few days &#8211; for Maven. Checkstyle Analysis Checkstyle is the analyzer of choice for enforcing a coding standard. It is a [&hellip;]<\/p>\n","protected":false},"author":194,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[253,1,249],"tags":[],"class_list":["post-21275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-devops-server","category-devops","category-open-source"],"acf":[],"blog_post_summary":"<p>A few sprints\u00a0ago we enabled SonarQube\u00a0and PMD\u00a0analysis on the Maven and Gradle tasks. We continue to add code analysis tooling to the Java build tasks with Checkstyle support for Gradle, and &#8211; in a few days &#8211; for Maven. Checkstyle Analysis Checkstyle is the analyzer of choice for enforcing a coding standard. It is a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/21275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/194"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=21275"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/21275\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=21275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=21275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=21275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}