Deploying 3rd party packages to my internal repo using maven using custom wagon
Asked Answered
U

1

8

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?

Unwish answered 8/5, 2017 at 22:9 Comment(0)
N
2

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.

Novelize answered 13/5, 2017 at 14:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.