开发者

Using mvn deploy via webdav: directory creation

I managed to setup maven so it automatically uploads the latest snapshot of our software to our public maven repository. This works fine so far, there is only a minor shortcoming that I just can not handle:

When deploying a new Snapshot, say for example: <version>1.2-SNAPSHOT</version> a directory named 1.2-SNAPSHOT has to be present on our webserver's maven directory, otherwise maven will fail, stating:

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 usually when starting a new snapshot this very directory i开发者_运维问答s not yet present so I end up creating it manually.

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


Are you sure that it is not a server side problem? I deployed a some libraries using Webdav (over HTTPS) and first time (with directory creation) it worked.

The Pom.xml should 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 might need to log on the server. To do this you need to add in the server part of the setting.xml the credentials for RepoId (see id of the repository in the pom).

<server>
   <id>RepoId</id>
   <username>login</username>
   <password>pass</password>
</server>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜