Tips for uploading very large files to Nexus

There are no artifact upload size limits in Nexus.

There is one caveat to the above though. If you're using Maven 2 you need to use the httpclient based wagon. The default wagon used in Maven 2 uses the built in JDK HTTP classes, and these load the entire request into memory before sending it. This could cause OOM's in Maven for very large artifacts.

To get Maven 2 to use the httpclient based wagon add the following to your pom file - making sure to use version 2.1, higher versions won't work with Maven2:

<extensions>
  <extension>
     <groupId>org.apache.maven.wagon</groupId>
     <artifactId>wagon-http</artifactId>
     <version>2.1</version>
     </extension>
     ...
</extensions>

And change the server definition in your Maven settings.xml:

<settings>
   ...
   <servers>
      <server>
         <id>central</id>
         <configuration>
            <wagonProvider>httpclient</wagonProvider>
         ...
         </configuration>
   </server>

Note: Maven 3 uses the httpclient based wagon by default, so there isn't any need to configure anything when using it.

Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk