Tuesday, September 29, 2009

Server timeout for maven release:perform or site:deploy

I just wanted to release a piece of software I'm working on when I encountered a wall. Big, high and not very talkative wall - read timeout. I thought maybe the configuration of the server (and Web DAV) I described in this post has changed? No way - everything is like it was. The only thing that has changed is Maven version from 2.0.9 to 2.2.1 (where you don't have to define DAV extension in the build part).

Fortunately I also had my old environment where it worked (I meanMmaven 2.0.9). I noticed that the full build takes over 2 minutes while on the new Maven I get the timeout after 1 minute and few seconds. This way I realized that maybe increasing the timeout value will help. IT DID!!!

So how to do this? It's simple - just add:
<servers>
  <server>
    <id>someId</id>
    <username>blahblah</username>
    <password>blahblah</password>
    <configuration>
      <timeout>120000</timeout> <!-- your timeout in milliseconds -->
    </configuration>
  </server>
  ...
in the MAVEN_HOME/conf/settings.xml file and restart your Maven task.

Enjoy!

2 comments:

Tiklup said...

But I don't understand what server id is about? Does it correlate to the repository ids?

Przemysław Bielicki said...

Good question Tiklup.

Check the previous article. Basically servers/server/id from MAVEN_HOME/conf/settings.xml maps to distributionManagement/repository/id in your pom.xml.

Details in the previous article.