title: Maven Javadoc Plugin During Site Goal: javadoc: error - java.lang.OutOfMemoryError: Please increase memory
body: <p>I have been struggling to increase the memory of my javadoc plugin via my pom file.  For some reason my Mac build slave fails during the <em>site</em> goal with an <em>OutOfMemoryError</em>.  I tried adjusting the <em>maxmemory</em> of the javadoc plugin via my <em>pluginManagement</em> section of the pom (as per the <a href="http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html#maxmemory" rel="nofollow">maven-javadoc-plugin documentation</a>):</p>
  
  <pre><code>...
  &lt;build&gt;
    ...
    &lt;pluginManagement&gt;
      &lt;plugins&gt;
        ...
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.8.1&lt;/version&gt;
          &lt;configuration&gt;
            &lt;maxmemory&gt;512m&lt;/maxmemory&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
    &lt;pluginManagement&gt;
    ...
  &lt;/build&gt;
  ...
  </code></pre>
  
  <p>This didn't seem to help anything, my build still failed with an out of memory error.</p>
  
  <p>So I decided to put this directly in my plugin declaration instead (see the <em>build-plugins-plugin</em> section below:</p>
  
  <pre><code>...
  &lt;build&gt;
    ...
    &lt;pluginManagement&gt;
      &lt;plugins&gt;
        ...
        &lt;plugin&gt;
          &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
          &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.8.1&lt;/version&gt;
        &lt;/plugin&gt;
        ...
      &lt;/plugins&gt;
    &lt;pluginManagement&gt;
    &lt;plugins&gt;
      ...
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
        &lt;configuration&gt;
          &lt;maxmemory&gt;512m&lt;/maxmemory&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
      ...
    &lt;/plugins&gt;
    ...
  &lt;/build&gt;
  ...
  </code></pre>
  
  <p>...and yet this is still not working, the Mac build slave still fails during the site goal.</p>