How can i use my own wagon to deploy 3rd party packages to my remote repository?
For example i can deploy a 3rd party package without altering pom.xml using the following command.
mvn deploy -DaltDeploymentRepository=thirdparty::default::http://myremoserver.com/mavenrepository/thirdparty -f thirpartpomfile -Dmaven.install.skip=true -Dmaven.test.skip=true
How can i tell maven to use a specific wagon for deploying packages? Can i pass some command line argument or add some entry to settings.xml?
How can i do the same for gradle?
The "Guide to deploying 3rd party JARs to remote repository" only mention:
First, the wagon-provider(
wagon-ftp
,wagon-file
, etc..) must be placed to your${maven.home}/lib
.
That is enough for you to use mvn deploy-file
with other protocols.
Your own wagon should be copied there (${maven.home}/lib
).
See Maven Deploy File Plugin FAQ:
If you are using the deploy:deploy-file goal and encounter this error:
Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp"
Then you need to place the appropriate wagon provider in your %M2_HOME%/lib.
If the error description is something like this:
Error deploying artifact: Unsupported Protocol: 'ftp': Cannot find wagon which supports the requested protocol: ftp org/apache/commons/net/ftp/FTP"
Then you need to place the
commons-net
jar in%M2_HOME%/lib
.
With Gradle, you can do the same, but with the Maven plugin, delegating the deploy-file to maven, since the Maven Deployer plugin might not support custom protocols.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With