title: How to exclude jasperreports artifact from jasperreports maven plugin
body: <p>I have below plugin in my pom:</p>
  
  <pre><code>&lt;plugin&gt;
                      &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                      &lt;artifactId&gt;jasperreports-maven-plugin&lt;/artifactId&gt;
                      &lt;version&gt;1.0-beta-2&lt;/version&gt;
                      &lt;dependencies&gt;                       
                          &lt;dependency&gt;
                              &lt;!-- The dependency specified by the plugin doesn't work so we must provide our own --&gt;
                              &lt;groupId&gt;net.sf.jasperreports&lt;/groupId&gt;
                              &lt;artifactId&gt;jasperreports&lt;/artifactId&gt;
                              &lt;version&gt;${jasperreports.version}&lt;/version&gt;
                              &lt;exclusions&gt;
                                  &lt;exclusion&gt;
                                      &lt;groupId&gt;jfree&lt;/groupId&gt;
                                      &lt;artifactId&gt;jcommon&lt;/artifactId&gt;
                                  &lt;/exclusion&gt;
                                  &lt;exclusion&gt;
                                      &lt;groupId&gt;com.lowagie&lt;/groupId&gt;
                                      &lt;artifactId&gt;itext&lt;/artifactId&gt;
                                  &lt;/exclusion&gt;
                              &lt;/exclusions&gt;
                          &lt;/dependency&gt;
                          &lt;!-- Groovy compiler seems to be required but not part of JasperReports' specified dependencies--&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;org.codehaus.groovy&lt;/groupId&gt;
                              &lt;artifactId&gt;groovy-all&lt;/artifactId&gt;
                              &lt;version&gt;${groovy.version}&lt;/version&gt;
                          &lt;/dependency&gt;
                          &lt;dependency&gt;
                              &lt;groupId&gt;com.lowagie&lt;/groupId&gt;
                              &lt;artifactId&gt;itext&lt;/artifactId&gt;
                              &lt;version&gt;${itext.version}&lt;/version&gt;
                          &lt;/dependency&gt;
                      &lt;/dependencies&gt;
                  &lt;/plugin&gt;
  </code></pre>
  
  <p>The 1.0-beta-2 version of the above plugin points to jasperreports artifact of version 1.2.0, which in turn points to an open-ended commons-collections of [2.1, )
  In 1.0-beta-2 pom:</p>
  
  <pre><code>&lt;dependency&gt;
        &lt;groupId&gt;jasperreports&lt;/groupId&gt;
        &lt;artifactId&gt;jasperreports&lt;/artifactId&gt;
        &lt;version&gt;1.2.0&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>And in jasperreports 1.2.0 pom:</p>
  
  <pre><code>&lt;dependency&gt;
              &lt;groupId&gt;commons-collections&lt;/groupId&gt;
              &lt;artifactId&gt;commons-collections&lt;/artifactId&gt;
              &lt;version&gt;[2.1,)&lt;/version&gt;
              &lt;scope&gt;compile&lt;/scope&gt;
          &lt;/dependency&gt;
  </code></pre>
  
  <p>In my case, there has been an push by someone else to a nexus repostiory, an artifact called 3.2.1-redhat-7 commons-collections. 
  jasperreports-maven-plugin is pointing to the above collections version which happens to be a corrupt one. There is a valid 3.2.1 version of commons collection. I need to exclude the jasperreports artifact and force the jasperreports-maven-plugin to use net.sf.jasperreports. 
  I have alread tried adding </p>
  
  <pre><code>&lt;dependency&gt;
                              &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                              &lt;artifactId&gt;jasperreports-maven-plugin&lt;/artifactId&gt;
                              &lt;version&gt;1.0-beta-2&lt;/version&gt;
                              &lt;exclusions&gt;
                                  &lt;exclusion&gt;
                                      &lt;groupId&gt;jasperreports&lt;/groupId&gt;
                                      &lt;artifactId&gt;jasperreports&lt;/artifactId&gt;
                                  &lt;/exclusion&gt;
                              &lt;/exclusions&gt;
                          &lt;/dependency&gt;
  </code></pre>
  
  <p>to the above plugin, but it still points to the same 1.2.0 jasperreports that points to an open-ended commons-collections, and the build fails. 
  However if i comment out the dependency "jasperreports" in the jasperreports-maven-plugin.pom, it uses the jasperreports from net.sf.jasperreports and builds fine. 
  Please let me know.</p>