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:
With this configuration it is possible to deploy large files both with dav and with plain http.