Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-beta-2
-
None
-
Maven version: 2.0.9
Java version: 1.5.0_12
OS name: "linux" version: "2.6.22" arch: "i386" Family: "unix"
Description
When trying to deploy to our webdav maven-repository the following exception occurs:
[...]
[INFO] [install:install]
[INFO] Installing /home/sw/my-project/target/my-project.jar to /opt/maven/repository/my-project/1.0-SNAPSHOT/my-project-1.0-SNAPSHOT.jar
[INFO] [deploy:deploy]
altDeploymentRepository = null
[INFO] Retrieving previous build number from maven-host
Uploading: http://maven-host/maven/my-project/1.0-SNAPSHOT/my-project-1.0-20080416.104050-26.jar
org.apache.commons.httpclient.HttpException: Unbuffered entity enclosing request can not be repeated.
at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:436)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2316)
at org.apache.commons.httpclient.HttpMethodBase.processRequest(HttpMethodBase.java:2651)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1087)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:643)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:497)
at org.apache.maven.wagon.providers.webdav.CorrectedWebdavResource.putMethod(CorrectedWebdavResource.java:156)
at org.apache.maven.wagon.providers.webdav.WebDavWagon.put(WebDavWagon.java:287)
at org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:244)
at org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:160)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:80)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:162)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error deploying artifact: PUT request for: my-project/1.0-SNAPSHOT/my-project-1.0-20080416.104050-26.jar to my-project.jar failed
Unbuffered entity enclosing request can not be repeated.
[...]
The access.log of our maven-repository show the following:
[...]
maven-host - [16/Apr/2008:12:44:00 +0200] "MKCOL /maven/my-project/1.0-SNAPSHOT/ HTTP/1.1" 401 401 "" "Jakarta Commons-HttpClient/2.0.2" "" "" "" "" "" "-" "112"
maven-host devbuild [16/Apr/2008:12:44:00 +0200] "MKCOL /maven/my-project/1.0-SNAPSHOT/ HTTP/1.1" 405 236 "" "Jakarta Commons-HttpClient/2.0.2" "" "" "" "" "" "-" "123"
maven-host - [16/Apr/2008:12:44:00 +0200] "PUT /maven/my-project/1.0-SNAPSHOT/my-project-1.0-20080416.104050-26.jar HTTP/1.1" 401 401 "" "Jakarta Commons-HttpClient/2.0.2" "" "" "" "" "" "-" "15853"
maven-host devbuild [16/Apr/2008:12:44:00 +0200] "PUT /maven/my-project/1.0-SNAPSHOT/my-project-1.0-20080416.104050-26.jar HTTP/1.1" 201 262 "" "Jakarta Commons-HttpClient/2.0.2" "" "" "" "" "" "-" "9090"
[...]
This shows that every request without auth-info ist retried with auth-info automatically, but the payload of the PUT request is missing the JAR-content.
In some forum I found the hint that the buffering of the content within http-client can be forced via setting the ContentLength to AUTO.
So I changed the following:
{{
// method.setRequestContentLength( contentLength );
method.setRequestContentLength( PutMethod.CONTENT_LENGTH_AUTO );
}}
This resolves the problem, but I don't know if there are some unwanted side-effects.