lives
lives

Reputation: 1195

Clarification regarding uploading jars to artifactory using maven

https://maven.apache.org/guides/mini/guide-central-repository-upload.html

As per the above link , we can use maven plugin to upload jars to our own internal artifcatory. What I observed is that transitive dependencies are not getting uploaded to the artifactory . We need to manually specify all the transitive dependencies.

Is there any way to enforce that all transitive dependencies are also uploaded to the artifactory based upon the main dependency specified in the pom.xml ?

Or is this achievable using gradle ?

Upvotes: 0

Views: 260

Answers (1)

Dror Bereznitsky
Dror Bereznitsky

Reputation: 20386

The common practice is setting up one or more remote repositories, proxying external repositories, such a JCenter and Maven Central, which contains the 3rd party dependencies you need. The remote repositories serves as a caching proxy.
Usually you aggregate the remote repositories (together with local ones) using a virtual repository. This virtual repository is the one used by developers and CI servers. This way developers only need to deal with a single URL.

In case your organization does not allow direct internet connection and developers cannot use remote repositories, you can use a setup of 2 Artifactory instances:

  • One instance inside the internal network with no internet connection
  • Second instance in the DMZ with internet connection

The idea is to resolve dependencies in the DMZ, approve them (or not) and copy the approved ones to the internal network.
You can read more about such a setup in the following blog post by Shani Levy - Using Artifactory with an air gap

Upvotes: 3

Related Questions