title: How to run Spotbugs via Maven?
body: <p>This is my <code>pom.xml</code>:</p>
  <pre><code>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; 
   xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
   xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0   
   http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
       &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; 
  
       &lt;groupId&gt;de.stackoverflow.test&lt;/groupId&gt;
       &lt;artifactId&gt;HelloWorld&lt;/artifactId&gt;
       &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
       &lt;packaging&gt;jar&lt;/packaging&gt; 
       &lt;name&gt;HelloWorld&lt;/name&gt; 
  
       &lt;dependencies&gt;   
               &lt;dependency&gt;
                  &lt;groupId&gt;com.github.spotbugs&lt;/groupId&gt;
                  &lt;artifactId&gt;spotbugs-annotations&lt;/artifactId&gt;
                  &lt;version&gt;3.1.0-RC5&lt;/version&gt;
                  &lt;optional&gt;true&lt;/optional&gt;
              &lt;/dependency&gt;
       &lt;/dependencies&gt;
  
       &lt;build&gt;        
          &lt;plugins&gt;
             &lt;plugin&gt;
             &lt;groupId&gt;com.github.hazendaz.spotbugs&lt;/groupId&gt;
             &lt;artifactId&gt;spotbugs-maven-plugin&lt;/artifactId&gt;
             &lt;version&gt;3.0.6&lt;/version&gt;
             &lt;dependencies&gt;
  
             &lt;dependency&gt;
             &lt;groupId&gt;com.github.spotbugs&lt;/groupId&gt;
             &lt;artifactId&gt;spotbugs&lt;/artifactId&gt;
             &lt;version&gt;3.1.0-RC5&lt;/version&gt;
             &lt;/dependency&gt;
             &lt;/dependencies&gt;
             &lt;/plugin&gt;
          &lt;/plugins&gt;
       &lt;/build&gt;
  </code></pre>
  
  <p><code>mvn compile</code>, <code>mvn package</code> and <code>mvn site</code> run without any problems. <em>Build Success.</em></p>
  <p>The project consists of a single <code>HelloWorld.java</code> with some bugs in it.</p>
  <p><code>mvn site</code> does not show me any bugs or errors. How do I get SpotBugs to scan my code?</p>