Using mvn deployment via webdav: creating a directory

I was able to configure maven to automatically download the latest snapshot of our software into our public maven repository. While this works great, there is only a minor flaw that I just can't handle:

When you deploy a new snapshot, say, for example: a <version>1.2-SNAPSHOT</version> directory with a name 1.2-SNAPSHOTmust be present in our maven web server directory, otherwise maven will fail by indicating:

Failed to deploy artifacts: Could not transfer artifact ... from/to basex.mvn (http://abc.de/webdav/): Access denied to: http://abc.de/webdav/1.2-SNAPSHOT/...

As usual, when starting a new snapshot, this same directory does not exist yet, so I create it manually.

Do you have any ideas on how to get around this and create maven to create this folder?

+5
source share
1 answer

Are you sure this is not a server side issue? I deployed some libraries using Webdav (via HTTPS) and the first time (with creating directories).

Pom.xml must contain a description of the distribution server.

<distributionManagement>
   <repository>
      <id>RepoId</id>
      <name>Name of the Maven repository</name>
      <url>dav:https://thewebdavurl/</url>
      <uniqueVersion>false</uniqueVersion>
   </repository>
</distributionManagement>

To enable directory creation, you may need to log in to the server. To do this, you need to add setting.xmlcredentials to the server side for RepoId(see Repository ID in pom).

<server>
   <id>RepoId</id>
   <username>login</username>
   <password>pass</password>
</server>
+1
source

All Articles