ftr
ftr

Reputation: 2145

Upload an artifact and its dependencies to a remote repository

I got the following problem: the customer provided me with a copy of his maven repository to get access to internal libraries. I need to upload the relevant artifact and its dependencies to our (a different) artifactory repository. This is quite an elaborate dependency tree unfortunately.

I tried the maven deploy plugin, but that only uploads a single file and not the dependencies. Does anyone have an idea on how to get the artifact with all its dependencies into our repo?

Upvotes: 0

Views: 787

Answers (2)

Kumar Sambhav
Kumar Sambhav

Reputation: 7765

You can create Maven profiles to pull from client's repository and to push to your own enterprise repository.

While running you maven goals, mention the profile using -P flag.

For example:- mvn clean install -P client-profile

Upvotes: 0

Dror Bereznitsky
Dror Bereznitsky

Reputation: 20386

There are multiple approaches you can take:

  1. Create a remote repository in your organization Artifactory instance and proxy the customer Maven repository. Using Maven get the required artifacts from the remote repository. Maven will ask for all required dependencies as part of the resolution. Eventually you will have everything you need cached in your Artifactory instance.
  2. Ask the customer to provide a Zip file with the required artifacts in Maven2 layout and import it to Artifactory. This Zip can be created, for example, from a Maven local cache.

Upvotes: 1

Related Questions