Uploading artifacts to Archiva with webdav

Archiva natively supports webdav to upload artifacts on a managed repository.


  • Create a managed repository
  • Add to a user the Manager Role for this repository
  • Then you'll need to tell maven's settings.xml file about your username and password (this file belongs in ~/.m2):
  • Below we suppose that you defined two repositories, one for releases (YOUR_REPOSITORY_FOR_RELEASES_ID, YOUR_REPOSITORY_FOR_RELEASES_URL) and one for snapshots (YOUR_REPOSITORY_FOR_SNAPSHOTS_ID, YOUR_REPOSITORY_FOR_SNAPSHOTS_URL)

Maven 1.x

Upload third party artifact

  • This feature isn't yet supported by the artifact plugin. We'll had it ASAP.

Upload project's artifact

  • The webdav protocol isn't yet supported by the artifact plugin. It's quite easy to had (And I already succeded to do it). I'll commit the change and publish a snapshot soon....
  • Sample of settings :
# Repository to deploy to

# These must be set elsewhere

# Repository to deploy snapshots

Maven 2.x

Upload third party artifact

Maven 2.0.x does not yet natively support the webdav protocol to upload artifacts. See http://jira.codehaus.org/browse/MNG-2664 for more information.

Meanwhile, you can use a simple pom.xml file containing the wagon-webdav build extension, as described here: http://maven.apache.org/archiva/guides/getting-started/maven-configuration.html

And then deploy your artifact:

mvn deploy:deploy-file \
    -DrepositoryId=<YOUR_REPO_ID> \
    -Durl=dav:<YOUR_REPO_URL> \
    -DgroupId=<GROUP_ID> \
    -DartifactId=<ARTIFACT_ID> \
    -Dversion=<VERSION> \
    -Dpackaging=<PACKAGING> \

or (note that pomFile is pom that goes with the artifact, not the simple one mentioned above.)

mvn deploy:deploy-file \
    -DrepositoryId=<YOUR_REPO_ID> \
    -Durl=dav:<YOUR_REPO_URL> \

Upload project's artifact 

You need to tell the <build> section about the Wagon WebDAV plugin:


Next you'll need to update your distributionManagement section:

  <name>Central Repository</name>
  <name>Central Development Repository</name>

You can put <distributionManagement> in the parent pom for a multi-module project. It will be inherited by the child projects, which can override it if necessary.

Performing a deployment

  • Now you can use the normal maven deploy command:
$ mvn deploy
  • Your SNAPSHOT repository will be viewable at: YOUR_REPOSITORY_FOR_RELEASES_URL
  • Your release repository will viewable at: YOUR_REPOSITORY_FOR_SNAPSHOTS_URL
  • You will need to navigate down to the appropriate location for your artifacts.
  • No labels