Home > Java > Deploying large files with Maven

Deploying large files with Maven

At a customer site we are using Sonatype Nexus as a local Maven repository. It stores our own artifacts as well as binary third-party components. Nexus runs as a web application in Tomcat 6 behind an Apache 2.2 web server. Yesterday I had a very frustrating problem: it was impossible to deploy large files with deploy:deploy-file. Small files worked every time.

What to do? I tried all Apache and Tomcat options I could find that seemed relevant. I also configured Maven to use dav instead of http. That required the use of a local dummy pom:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>localdomain.localhost</groupId>
  <artifactId>dummy</artifactId>
  <version>1.0-SNAPSHOT</version>
  <build>
    <extensions>
         <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-webdav-jackrabbit</artifactId>
            <version>1.0-beta-7</version>
         </extension>
    </extensions>
  </build>
</project>


With this in place and -DgeneratePom=true on the command line I could deploy to dav:http://server/path. Still no luck, though.

I finally found a solution. If Apache is configured to use keep-alives it works! Edit httpd.conf and set:

KeepAlive On


With this configuration it is possible to deploy large files both with dav and with plain http.

Advertisements
Categories: Java
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: