{"id":20792,"date":"2014-02-02T15:00:31","date_gmt":"2014-02-02T13:00:31","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/?p=20792"},"modified":"2014-02-01T11:05:04","modified_gmt":"2014-02-01T09:05:04","slug":"findbugs-maven-plugin-tutorial","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html","title":{"rendered":"FindBugs Maven Plugin Tutorial"},"content":{"rendered":"<p><a href=\"http:\/\/findbugs.sourceforge.net\/\" target=\"_blank\">FindBugs<\/a> is a static code analysis tool which identifies problems found from Java code.<\/p>\n<p>We can integrate FindBugs into our build process by using the <a href=\"http:\/\/mojo.codehaus.org\/findbugs-maven-plugin\/\" target=\"_blank\">FindBugs Maven plugin<\/a>. This blog post identifies four typical use cases and describes how we can configure the FindBugs Maven plugin to support each use case.<\/p>\n<p>The described use cases are:<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<ol>\n<li>Create FindBugs report as a part of the project reports.<\/li>\n<li>Fail the build if FindBugs finds problems from the source code.<\/li>\n<li>Create a XML report without failing the build.<\/li>\n<li>Create both XML and HTML reports without creating the site.<\/li>\n<\/ol>\n<p>Let\u2019s get started.<\/p>\n<h2>Use Case 1: Create Findbugs Report as a Part of the Project Reports<\/h2>\n<p>Sometimes we don\u2019t want to run static code analysis every time when our project is compiled. Instead we want to run it manually when we need it. If this is the case, our best option is to create the FindBugs report when we create the site of the project.<\/p>\n<p>We can do this by following these steps:<\/p>\n<ol>\n<li>Add the declaration of the FindBugs Maven plugin to the <em>reporting<\/em> section of the <em>pom.xml<\/em> file.<\/li>\n<li>Configure the FindBugs Maven plugin by following these steps:\n<ol>\n<li>Ensure that most accurate analysis is performed.<\/li>\n<li>Ensure that all bugs are reported.<\/li>\n<li>Ensure that XML report is generated.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>The relevant part of the <em>pom.xml<\/em> file looks as follows:<\/p>\n<pre class=\"brush:xml\">&lt;reporting&gt;\r\n    &lt;plugins&gt;\r\n        &lt;plugin&gt;\r\n            &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;findbugs-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;version&gt;2.5.2&lt;\/version&gt;\r\n            &lt;configuration&gt;\r\n                &lt;!--\r\n                   Enables analysis which takes more memory but finds more bugs.\r\n                   If you run out of memory, changes the value of the effort element\r\n                   to 'low'.\r\n               --&gt;\r\n                &lt;effort&gt;Max&lt;\/effort&gt;\r\n                &lt;!-- Reports all bugs (other values are medium and max) --&gt;\r\n                &lt;threshold&gt;Low&lt;\/threshold&gt;\r\n                &lt;!-- Produces XML report --&gt;\r\n                &lt;xmlOutput&gt;true&lt;\/xmlOutput&gt;\r\n            &lt;\/configuration&gt;\r\n        &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n&lt;\/reporting&gt;<\/pre>\n<blockquote>\n<p>The report is <a href=\"http:\/\/stackoverflow.com\/questions\/8564208\/how-to-generate-a-html-report-for-findbugs-with-maven-3-x\" target=\"_blank\">created only when the project is compiled<\/a>.\n<\/p>\n<\/blockquote>\n<p>In other words, when we want to create the FindBugs report, we have to run the following command at command prompt:<\/p>\n<pre class=\"brush:bash\">mvn clean compile site<\/pre>\n<p>Let\u2019s move on and find out how we can fail the build if FindBugs finds problems from our source code.<\/p>\n<h2>Use Case 2: Fail the Build if Problems Are Found<\/h2>\n<p>If we want to be sure that our code doesn\u2019t contain even a minor problem, it might be good idea to run static code analysis every time when our project is compiled. Of course, this makes sense only if the build is failed when a problem is found.<\/p>\n<p>In other words, we have to configure the FindBugs Maven plugin to fail the build if problems are found. We can do this by following these steps:<\/p>\n<ol>\n<li>Add the plugin declaration to the <em>plugins<\/em> section of the <em>pom.xml<\/em> file.<\/li>\n<li>Configure the FindBugs Maven plugin by following these steps:\n<ol>\n<li>Ensure that most accurate analysis is performed.<\/li>\n<li>Ensure that all bugs are reported.<\/li>\n<li>Ensure that XML report is generated.<\/li>\n<li>Configure the plugin to create the XML report to the directory <em>${project.build.directory}\/findbugs<\/em>.<\/li>\n<\/ol>\n<\/li>\n<li>Add an execution which runs the plugin\u2019s <em>check<\/em> goal during the <em>compile<\/em> Maven lifecycle phase.<\/li>\n<\/ol>\n<p>The relevant part of the <em>pom.xml<\/em> file looks as follows:<\/p>\n<pre class=\"brush: xml;wrap-lines: false\">&lt;build&gt;\r\n    &lt;plugins&gt;\r\n        &lt;plugin&gt;\r\n            &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;findbugs-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;version&gt;2.5.2&lt;\/version&gt;\r\n            &lt;configuration&gt;\r\n                &lt;!--\r\n                   Enables analysis which takes more memory but finds more bugs.\r\n                   If you run out of memory, changes the value of the effort element\r\n                   to 'Low'.\r\n               --&gt;\r\n                &lt;effort&gt;Max&lt;\/effort&gt;\r\n                &lt;!-- Reports all bugs (other values are medium and max) --&gt;\r\n                &lt;threshold&gt;Low&lt;\/threshold&gt;\r\n                &lt;!-- Produces XML report --&gt;\r\n                &lt;xmlOutput&gt;true&lt;\/xmlOutput&gt;\r\n                &lt;!-- Configures the directory in which the XML report is created --&gt;\r\n                &lt;findbugsXmlOutputDirectory&gt;${project.build.directory}\/findbugs&lt;\/findbugsXmlOutputDirectory&gt;\r\n            &lt;\/configuration&gt;\r\n            &lt;executions&gt;\r\n                &lt;!--\r\n                   Ensures that FindBugs inspects source code when project is compiled.\r\n               --&gt;\r\n                &lt;execution&gt;\r\n                    &lt;id&gt;analyze-compile&lt;\/id&gt;\r\n                    &lt;phase&gt;compile&lt;\/phase&gt;\r\n                    &lt;goals&gt;\r\n                        &lt;goal&gt;check&lt;\/goal&gt;\r\n                    &lt;\/goals&gt;\r\n                &lt;\/execution&gt;\r\n            &lt;\/executions&gt;\r\n        &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n&lt;\/build&gt;<\/pre>\n<p>This configuration ensures that the check goal of the Maven FindBugs plugin is invoked during the compile Maven lifecycle phase. If FindBugs finds problems from the source code, it fails the build.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>Let\u2019s move on and find out how we can create XML report without creating the site or failing the build.<\/p>\n<h2>Use Case 3: Create XML Report Without Failing the Build<\/h2>\n<p>If we want to <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/FindBugs+Plugin\" target=\"_blank\">integrate Jenkins with FindBugs<\/a>, we need to find a way to create XML reports without failing the build.<\/p>\n<p>We can configure the FindBugs Maven plugin to do this by following these steps:<\/p>\n<ol>\n<li>Configure the FindBugs Maven plugin as described in the previous section (Use case 2).<\/li>\n<li>Ensure that the build doesn\u2019t fail if problems are found by setting the value of the <em>failOnError<\/em> configuration property to <em>false<\/em>.<\/li>\n<\/ol>\n<p>The relevant part of the <em>pom.xml<\/em> file looks as follows:<\/p>\n<pre class=\"brush: xml;wrap-lines: false\">&lt;build&gt;\r\n    &lt;plugins&gt;\r\n        &lt;plugin&gt;\r\n            &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;findbugs-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;version&gt;2.5.2&lt;\/version&gt;\r\n            &lt;configuration&gt;\r\n                &lt;!--\r\n                   Enables analysis which takes more memory but finds more bugs.\r\n                   If you run out of memory, changes the value of the effort element\r\n                   to 'Low'.\r\n               --&gt;\r\n                &lt;effort&gt;Max&lt;\/effort&gt;\r\n                &lt;!-- Build doesn't fail if problems are found --&gt;\r\n                &lt;failOnError&gt;false&lt;\/failOnError&gt;\r\n                &lt;!-- Reports all bugs (other values are medium and max) --&gt;\r\n                &lt;threshold&gt;Low&lt;\/threshold&gt;\r\n                &lt;!-- Produces XML report --&gt;\r\n                &lt;xmlOutput&gt;true&lt;\/xmlOutput&gt;\r\n                &lt;!-- Configures the directory in which the XML report is created --&gt;\r\n                &lt;findbugsXmlOutputDirectory&gt;${project.build.directory}\/findbugs&lt;\/findbugsXmlOutputDirectory&gt;\r\n            &lt;\/configuration&gt;\r\n            &lt;executions&gt;\r\n                &lt;!--\r\n                   Ensures that FindBugs inspects source code when project is compiled.\r\n               --&gt;\r\n                &lt;execution&gt;\r\n                    &lt;id&gt;analyze-compile&lt;\/id&gt;\r\n                    &lt;phase&gt;compile&lt;\/phase&gt;\r\n                    &lt;goals&gt;\r\n                        &lt;goal&gt;check&lt;\/goal&gt;\r\n                    &lt;\/goals&gt;\r\n                &lt;\/execution&gt;\r\n            &lt;\/executions&gt;\r\n        &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n&lt;\/Build&gt;<\/pre>\n<p>We can now create the XML report by compiling the project.<\/p>\n<p>The last use case describes how we can create both XML and HTML reports without creating the site or failing the build. Let\u2019s see how this is done.<\/p>\n<h2>Use Case 4: Create Both XML and HTML Reports Without Creating the Site<\/h2>\n<p>If we want to create both XML and HTML reports without creating the project site or failing the build, we have to follow these steps:<\/p>\n<ol>\n<li>Configure the FindBugs Maven plugin as described in the previous section (use case 3).<\/li>\n<li>Add the declaration of the <a href=\"http:\/\/mojo.codehaus.org\/xml-maven-plugin\/index.html\" target=\"_blank\">XML Maven Plugin<\/a> to the <em>plugins<\/em> section of the <em>pom.xml<\/em> file.<\/li>\n<li>Configure the plugin by following these steps:\n<ol>\n<li>Create a transformation set which transforms all XML files found from the <em>${project.build.directory}\/findbugs<\/em> directory and writes the results of the XSLT transformation to the same directory.<\/li>\n<li>Configure stylesheet which specifies the output of the XSLT transformation. The FindBugs library provides five stylesheets which can be used for this purpose. The available stylesheets are described in the sample configuration.<\/li>\n<li>Ensure that all output files of the XSLT transformation have the file extension <em>.html<\/em>.<\/li>\n<\/ol>\n<\/li>\n<li>Add an execution which invokes the <em>transform<\/em> goal of the XML Maven plugin during the <em>compile<\/em> Maven lifecycle phase.<\/li>\n<li>Add FindBugs (version 2.0.1) as the dependency of the plugin.<\/li>\n<\/ol>\n<p>The relevant part of the <em>pom.xml<\/em> file looks as follows:<\/p>\n<pre class=\"brush: xml;wrap-lines: false\">&lt;build&gt;\r\n    &lt;plugins&gt;\r\n        &lt;plugin&gt;\r\n            &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;findbugs-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;version&gt;2.5.2&lt;\/version&gt;\r\n            &lt;configuration&gt;\r\n                &lt;!--\r\n                   Enables analysis which takes more memory but finds more bugs.\r\n                   If you run out of memory, changes the value of the effort element\r\n                   to 'Low'.\r\n               --&gt;\r\n                &lt;effort&gt;Max&lt;\/effort&gt;\r\n                &lt;!-- Build doesn't fail if problems are found --&gt;\r\n                &lt;failOnError&gt;false&lt;\/failOnError&gt;\r\n                &lt;!-- Reports all bugs (other values are medium and max) --&gt;\r\n                &lt;threshold&gt;Low&lt;\/threshold&gt;\r\n                &lt;!-- Produces XML report --&gt;\r\n                &lt;xmlOutput&gt;true&lt;\/xmlOutput&gt;\r\n                &lt;!-- Configures the directory in which the XML report is created --&gt;\r\n                &lt;findbugsXmlOutputDirectory&gt;${project.build.directory}\/findbugs&lt;\/findbugsXmlOutputDirectory&gt;\r\n            &lt;\/configuration&gt;\r\n            &lt;executions&gt;\r\n                &lt;!--\r\n                   Ensures that FindBugs inspects source code when project is compiled.\r\n               --&gt;\r\n                &lt;execution&gt;\r\n                    &lt;id&gt;analyze-compile&lt;\/id&gt;\r\n                    &lt;phase&gt;compile&lt;\/phase&gt;\r\n                    &lt;goals&gt;\r\n                        &lt;goal&gt;check&lt;\/goal&gt;\r\n                    &lt;\/goals&gt;\r\n                &lt;\/execution&gt;\r\n            &lt;\/executions&gt;\r\n        &lt;\/plugin&gt;\r\n        &lt;plugin&gt;\r\n            &lt;groupId&gt;org.codehaus.mojo&lt;\/groupId&gt;\r\n            &lt;artifactId&gt;xml-maven-plugin&lt;\/artifactId&gt;\r\n            &lt;version&gt;1.0&lt;\/version&gt;\r\n            &lt;configuration&gt;\r\n                &lt;transformationSets&gt;\r\n                    &lt;transformationSet&gt;\r\n                        &lt;!-- Configures the source directory of XML files. --&gt;\r\n                        &lt;dir&gt;${project.build.directory}\/findbugs&lt;\/dir&gt;\r\n                        &lt;!-- Configures the directory in which the FindBugs report is written.--&gt;\r\n                        &lt;outputDir&gt;${project.build.directory}\/findbugs&lt;\/outputDir&gt;\r\n                        &lt;!-- Selects the used stylesheet. --&gt;\r\n                        &lt;!-- &lt;stylesheet&gt;fancy-hist.xsl&lt;\/stylesheet&gt; --&gt;\r\n                        &lt;stylesheet&gt;default.xsl&lt;\/stylesheet&gt;\r\n                        &lt;!--&lt;stylesheet&gt;plain.xsl&lt;\/stylesheet&gt;--&gt;\r\n                        &lt;!--&lt;stylesheet&gt;fancy.xsl&lt;\/stylesheet&gt;--&gt;\r\n                        &lt;!--&lt;stylesheet&gt;summary.xsl&lt;\/stylesheet&gt;--&gt;\r\n                        &lt;fileMappers&gt;\r\n                            &lt;!-- Configures the file extension of the output files. --&gt;\r\n                            &lt;fileMapper\r\n                                   implementation=\"org.codehaus.plexus.components.io.filemappers.FileExtensionMapper\"&gt;\r\n                                &lt;targetExtension&gt;.html&lt;\/targetExtension&gt;\r\n                            &lt;\/fileMapper&gt;\r\n                        &lt;\/fileMappers&gt;\r\n                    &lt;\/transformationSet&gt;\r\n                &lt;\/transformationSets&gt;\r\n            &lt;\/configuration&gt;\r\n            &lt;executions&gt;\r\n                &lt;!-- Ensures that the XSLT transformation is run when the project is compiled. --&gt;\r\n                &lt;execution&gt;\r\n                    &lt;phase&gt;compile&lt;\/phase&gt;\r\n                    &lt;goals&gt;\r\n                        &lt;goal&gt;transform&lt;\/goal&gt;\r\n                    &lt;\/goals&gt;\r\n                &lt;\/execution&gt;\r\n            &lt;\/executions&gt;\r\n            &lt;dependencies&gt;\r\n                &lt;dependency&gt;\r\n                    &lt;groupId&gt;com.google.code.findbugs&lt;\/groupId&gt;\r\n                    &lt;artifactId&gt;findbugs&lt;\/artifactId&gt;\r\n                    &lt;version&gt;2.0.1&lt;\/version&gt;\r\n                &lt;\/dependency&gt;\r\n            &lt;\/dependencies&gt;\r\n        &lt;\/plugin&gt;\r\n    &lt;\/plugins&gt;\r\n&lt;\/build&gt;<\/pre>\n<blockquote>\n<p>This solution was <a href=\"http:\/\/stackoverflow.com\/questions\/7035112\/any-easy-way-to-generate-a-findbug-html-report-from-maven-without-sitesite\/10365954#10365954\" target=\"_blank\">originally described in this StackOverflow question<\/a>.<\/p>\n<\/blockquote>\n<p>We can now create both HTML and XML reports by compiling our project.<\/p>\n<h2>Summary<\/h2>\n<p>We have now identified four typical use cases of the FindBugs Maven plugin and learned how we can configure the plugin to support each use case.<\/p>\n<p>If you know a use case that wasn\u2019t covered by this tutorial, please let me know by leaving a comment to this blog post.<\/p>\n<ul>\n<li>You can get the example application of this blog post from <a href=\"https:\/\/github.com\/pkainulainen\/maven-examples\/tree\/master\/findbugs-cookbook\" target=\"_blank\">Github<\/a>.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<div style=\"border: 1px solid #D8D8D8; background: #FAFAFA; width: 100%; padding-left: 5px;\"><b><i>Reference: <\/i><\/b><a href=\"http:\/\/www.petrikainulainen.net\/programming\/maven\/findbugs-maven-plugin-tutorial\/\">FindBugs Maven Plugin Tutorial<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/jcg\">JCG partner<\/a> Petri Kainulainen at the <a href=\"http:\/\/www.petrikainulainen.net\/\">Petri Kainulainen<\/a> blog.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the FindBugs Maven plugin. This blog post identifies four typical use cases and describes how we can configure the FindBugs Maven plugin to support each use case. The described use cases &hellip;<\/p>\n","protected":false},"author":429,"featured_media":73,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[68,140],"class_list":["post-20792","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-apache-maven","tag-findbugs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>FindBugs Maven Plugin Tutorial<\/title>\n<meta name=\"description\" content=\"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FindBugs Maven Plugin Tutorial\" \/>\n<meta property=\"og:description\" content=\"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-02T13:00:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Petri Kainulainen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/petrikainulaine\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Petri Kainulainen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html\"},\"author\":{\"name\":\"Petri Kainulainen\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5af4df3fdfeb79e9fa3598d79bff2c9e\"},\"headline\":\"FindBugs Maven Plugin Tutorial\",\"datePublished\":\"2014-02-02T13:00:31+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html\"},\"wordCount\":927,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"keywords\":[\"Apache Maven\",\"findbugs\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html\",\"name\":\"FindBugs Maven Plugin Tutorial\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"datePublished\":\"2014-02-02T13:00:31+00:00\",\"description\":\"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/apache-maven-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2014\\\/02\\\/findbugs-maven-plugin-tutorial.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"FindBugs Maven Plugin Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/5af4df3fdfeb79e9fa3598d79bff2c9e\",\"name\":\"Petri Kainulainen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g\",\"caption\":\"Petri Kainulainen\"},\"description\":\"Petri is passionate about software development and continuous improvement. He is specialized in software development with the Spring Framework and is the author of Spring Data book.\",\"sameAs\":[\"http:\\\/\\\/www.petrikainulainen.net\\\/\",\"http:\\\/\\\/www.linkedin.com\\\/in\\\/petrikainulainen\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/petrikainulaine\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/petri-kainulainen\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FindBugs Maven Plugin Tutorial","description":"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html","og_locale":"en_US","og_type":"article","og_title":"FindBugs Maven Plugin Tutorial","og_description":"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the","og_url":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2014-02-02T13:00:31+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","type":"image\/jpeg"}],"author":"Petri Kainulainen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/petrikainulaine","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Petri Kainulainen","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html"},"author":{"name":"Petri Kainulainen","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5af4df3fdfeb79e9fa3598d79bff2c9e"},"headline":"FindBugs Maven Plugin Tutorial","datePublished":"2014-02-02T13:00:31+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html"},"wordCount":927,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","keywords":["Apache Maven","findbugs"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html","url":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html","name":"FindBugs Maven Plugin Tutorial","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","datePublished":"2014-02-02T13:00:31+00:00","description":"FindBugs is a static code analysis tool which identifies problems found from Java code. We can integrate FindBugs into our build process by using the","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/apache-maven-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2014\/02\/findbugs-maven-plugin-tutorial.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"FindBugs Maven Plugin Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/5af4df3fdfeb79e9fa3598d79bff2c9e","name":"Petri Kainulainen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9e57425180f323fa65bc519a64c8273d3fcb7c6bd272e56b37dd15613f403659?s=96&d=mm&r=g","caption":"Petri Kainulainen"},"description":"Petri is passionate about software development and continuous improvement. He is specialized in software development with the Spring Framework and is the author of Spring Data book.","sameAs":["http:\/\/www.petrikainulainen.net\/","http:\/\/www.linkedin.com\/in\/petrikainulainen","https:\/\/x.com\/https:\/\/twitter.com\/petrikainulaine"],"url":"https:\/\/www.javacodegeeks.com\/author\/petri-kainulainen"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/20792","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/429"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=20792"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/20792\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/73"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=20792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=20792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=20792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}