title: Maven: change plugin deeper dependency version
body: <p>There are Maven plugins:</p>
  <ul>
  <li><code>org.apache.maven.plugins:maven-dependency-plugin:3.1.2</code></li>
  <li><code>org.apache.maven.plugins:maven-site-plugin:3.9.1</code></li>
  </ul>
  <p>that indirectly use <code>commons-beanutils:commons-beanutils:jar:1.7.0</code>. According to <a href="https://maven.apache.org/plugins/maven-site-plugin/dependencies.html#Project_Dependency_Graph" rel="nofollow noreferrer">this</a> the dependencies are:</p>
  <pre><code>org.apache.maven.plugins:maven-site-plugin:maven-plugin:3.9.1 [Information]
      org.apache.maven.doxia:doxia-site-renderer:jar:1.9.2 (compile) [Information]
          org.apache.velocity:velocity-tools:jar:2.0 (compile) [Information]
              commons-beanutils:commons-beanutils:jar:1.7.0 (compile) 
  </code></pre>
  <p>How to change the dependency version from <code>1.7.0</code> to <code>1.9.4</code> for these plugins?</p>
  <p>Here's an example POM and my solution that doesn't work:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &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;org.example&lt;/groupId&gt;
      &lt;artifactId&gt;freaking-beanutils&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;8&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.1.2&lt;/version&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
                          &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
                          &lt;version&gt;1.9.4&lt;/version&gt;
                      &lt;/dependency&gt;
  
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.maven.doxia&lt;/groupId&gt;
                          &lt;artifactId&gt;doxia-site-renderer&lt;/artifactId&gt;
                          &lt;version&gt;1.9.2&lt;/version&gt;
                          &lt;exclusions&gt;
                              &lt;exclusion&gt;
                                  &lt;groupId&gt;org.apache.velocity&lt;/groupId&gt;
                                  &lt;artifactId&gt;velocity-tools&lt;/artifactId&gt;
                              &lt;/exclusion&gt;
                          &lt;/exclusions&gt;
                      &lt;/dependency&gt;
  
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.velocity&lt;/groupId&gt;
                          &lt;artifactId&gt;velocity-tools&lt;/artifactId&gt;
                          &lt;version&gt;2.0&lt;/version&gt;
                          &lt;exclusions&gt;
                              &lt;exclusion&gt;
                                  &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
                                  &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
                              &lt;/exclusion&gt;
                          &lt;/exclusions&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
  
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
                  &lt;version&gt;3.9.1&lt;/version&gt;
                  &lt;dependencies&gt;
                      &lt;dependency&gt;
                          &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
                          &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
                          &lt;version&gt;1.9.4&lt;/version&gt;
                      &lt;/dependency&gt;
  
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.maven.doxia&lt;/groupId&gt;
                          &lt;artifactId&gt;doxia-site-renderer&lt;/artifactId&gt;
                          &lt;version&gt;1.9.2&lt;/version&gt;
                          &lt;exclusions&gt;
                              &lt;exclusion&gt;
                                  &lt;groupId&gt;org.apache.velocity&lt;/groupId&gt;
                                  &lt;artifactId&gt;velocity-tools&lt;/artifactId&gt;
                              &lt;/exclusion&gt;
                          &lt;/exclusions&gt;
                      &lt;/dependency&gt;
  
                      &lt;dependency&gt;
                          &lt;groupId&gt;org.apache.velocity&lt;/groupId&gt;
                          &lt;artifactId&gt;velocity-tools&lt;/artifactId&gt;
                          &lt;version&gt;2.0&lt;/version&gt;
                          &lt;exclusions&gt;
                              &lt;exclusion&gt;
                                  &lt;groupId&gt;commons-beanutils&lt;/groupId&gt;
                                  &lt;artifactId&gt;commons-beanutils&lt;/artifactId&gt;
                              &lt;/exclusion&gt;
                          &lt;/exclusions&gt;
                      &lt;/dependency&gt;
                  &lt;/dependencies&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
  
      &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  <p>Then execute</p>
  <pre><code>mvn -X dependency:resolve-plugins &gt; 11111.txt
  </code></pre>
  <p>to see something like this:</p>
  <pre><code>.  .  .
  [DEBUG] org.apache.maven.plugins:maven-dependency-plugin:jar:3.1.2:
  [DEBUG]    commons-beanutils:commons-beanutils:jar:1.9.4:runtime
  .  .  .
  [DEBUG] Populating class realm plugin&gt;org.apache.maven.plugins:maven-dependency-plugin:3.1.2
  [DEBUG]   Included: org.apache.maven.plugins:maven-dependency-plugin:jar:3.1.2
  [DEBUG]   Included: commons-beanutils:commons-beanutils:jar:1.9.4
  .  .  .
  [INFO]    org.apache.maven.plugins:maven-site-plugin:maven-plugin:3.9.1:runtime
  .  .  .
  [INFO]    org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:3.1.2:runtime
  . .  .
  [INFO]       commons-beanutils:commons-beanutils:jar:1.7.0
  .  .  .
  </code></pre>
  <p>Now we see that <code>commons-beanutils-1.7.0</code> is a dependency. Need to avoid it.</p>