From 9f0ebbcf90575d1c24ef392c31225fd1edf52602 Mon Sep 17 00:00:00 2001 From: Claus Stadler Date: Fri, 16 Feb 2024 14:44:50 +0100 Subject: [PATCH] Updated webdav deployment --- docs/deployment/webdav-deployment.md | 72 ++++++++++++++++------------ 1 file changed, 41 insertions(+), 31 deletions(-) diff --git a/docs/deployment/webdav-deployment.md b/docs/deployment/webdav-deployment.md index 4b15231..7422c4d 100644 --- a/docs/deployment/webdav-deployment.md +++ b/docs/deployment/webdav-deployment.md @@ -18,26 +18,26 @@ It is an extension to HTTP and is supported by many Web servers. Examples includ ## Caveats -* ⚠️ Maven's WebDAV provider (`wagon-webdav-jackrabbit`) is deprecated and subject to removal in Maven 4. It is unclear whether and when there will be a replacement. +> ⚠️ Maven's WebDAV provider (`wagon-webdav-jackrabbit`) is deprecated and subject to removal in Maven 4. It is unclear whether and when there will be a replacement. The example on this page was tested with Maven 3. -* > ⚠️ Just like there is `http://` and its secure version `https://` the same difference exists for WebDAV as it builds upon HTTP(s). +> ⚠️ Just like there is `http://` and its secure version `https://` the same difference exists for WebDAV as it builds upon HTTP(s). Using `dav://` in cases where secure webdav `davs://` is needed will result in errors. Typically it will be `permission denied` but it may also be `moved permanently` if the server tries to redirect. ## Approach -* The following `mvn` invocation requires the `pom.xml` and adaptions to the `settings.xml` below. -It will deploy a simple archive to the specified server. +The following `mvn` invocation requires appropriately adapted versions of the `pom.xml` and `settings.xml` files as described below. +It will deploy a simple archive to the specified server using: + ```bash -mvn - -D"webdav.url=davs://SERVER/nextcloud/remote.php/dav/files/USER" \ - -D"webdav.id.internal=my.webdav.internal" \ - -D"webdav.id.snapshots=my.webdav.snapshots" \ - deploy +mvn -P webdav deploy ``` -* Supply user name and password via `~/m2.settings.xml`: +> ℹ️ It is generally good practice to put distribution configurations, such as that for the webdav deployment - into profiles. +This allows one to easiliy deploy to a specific destination. + +Supply user name and password with appropriate `` sections in the `~/m2/settings.xml`: ```xml ``` -* `pom.xml` +The `pom.xml`: + ```xml 1.0.0-SNAPSHOT - - https://myserver/remote.php/dav/files/Me + + davs://SERVER/nextcloud/remote.php/dav/files/USERNAME + + + my.webdav.internal + my.webdav.snapshots . UTF-8 3.0.0 - - - - - me.myself.internal - My WebDAV-based Internal Repository - ${webdav.url} - false - - - me.myself.snapshots - My WebDAV-based Snapshot Repository - ${webdav.url} - false - - + - me.myself.internal + ${webdav.id.internal} My WebDAV-based Internal Repository ${webdav.url} - me.myself.snapshots + ${webdav.id.snapshots} My WebDAV-based Snapshot Repository ${webdav.url} + + + webdav + + + ${webdav.id.internal} + My WebDAV-based Internal Repository + ${webdav.url} + false + + + ${webdav.id.snapshots} + My WebDAV-based Snapshot Repository + ${webdav.url} + false + + + + +