Reputation: 8807
I can deploy to an 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 relative to my project's directory?
Upvotes: 12
Views: 16593
Reputation: 606
This is a very old thread, but so are the answers.
@tekumara's answer works fine, but only for maven version <= 2
this works for 3+
mvn deploy -DaltDeploymentRepository=local::file:./target/staging-deploy
note - this also explains and solves the "ArtifactDeployerException: Failed to retrieve remote metadata.." error mentioned below.
Upvotes: 0
Reputation: 77931
I don't think it can be done. File URLs require a mount point on the server, for example:
file://hostname/path/to/file
So, for a file on the local filesystem simply omits the "hostname" component (Explaining the 3 leading slashes):
file:///path/to/file
A relative path on the other hand assumes a starting position in the remote filesystem... Something that is impossible to support if one wants a URL to be unambiguous.
Upvotes: 0
Reputation: 8807
A relative directory can be specified when using the -DaltDeploymentRepository
parameter, e.g.:
mvn deploy -DaltDeploymentRepository=snapshot-repo::default::file:../../my-local-snapshots-dir
The file URL is relative to the directory in which mvn
is run.
See here for more info on the altDeploymentRepository
parameter.
Upvotes: 20