Search code examples
maven-2maven-3maven-release-pluginmaven-javadoc-plugin

javadoc: error - java.lang.OutOfMemoryError


I'm trying to create a release with maven-release-plugin. The goals I had executed are release:perpare and release:perform.

After maven creates the release and source jar, I get this memory error from javadoc execution.

 [INFO] javadoc: error - java.lang.OutOfMemoryError: Please increase memory.
 [INFO] For example, on the Sun Classic or HotSpot VMs, add the option -J-Xmx
 [INFO] such as -J-Xmx32m.
  1. In build section I have this:

    org.apache.maven.plugins maven-release-plugin 2.4.1 @{project.artifactId}-version-@{project.version}

  2. I tried to configure javadoc execution on this ways a. org.apache.maven.plugins maven-javadoc-plugin 2.9 -J-Xmx1024M b.

    org.apache.maven.plugins maven-javadoc-plugin 2.9 1024M

Someone knows what I can do to solve this error?

Thanks! Juan Pablo Proverbio


Solution

  • I solved it with this:

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <maxmemory>800m</maxmemory>
        </configuration>
    </plugin>
    

    before the maven-release-plugin definition.