Maven Deploys Path to Relative Directory

I can install in the absolute directory:

<distributionManagement> <repository> <id>absolute directory</id> <url>file:///home/tukushan/workspace/omcutil/repo</url> </repository> </distributionManagement> 

But how do I deploy to a directory in relation to my project directory?

+6
source share
2 answers

A relative directory can be specified using the -DaltDeploymentRepository parameter, for example:

mvn deployment -DaltDeploymentRepository = repo snapshot :: default :: File: ../../ my-local-snapshot-Dir

The file URL refers to the directory in which mvn is running.

Read more about the altDeploymentRepository parameter here .

+7
source

I do not think it can be done. File URLs require a mount point on the server, for example:

 file://hostname/path/to/file 

Thus, a file on the file system simply omits the host name component (explains 3 leading slashes)

 file:///path/to/file 

The relative path, on the other hand, assumes a starting position in the remote file system ... Something that cannot be supported if you want the URL to be unambiguous

-1
source

Source: https://habr.com/ru/post/926033/


All Articles