0

I installed Artifactory and now I want to use a local repo to store maven dependencies that'll be used during the build. How can the dependencies be uploaded, please note the server is not connected to internet. How will the dependencies be uploaded manually and how will it be further used in the build.

I'm trying to create a local repo in Artifactory; I am creating it to store the dependencies but in the configuration it has checkboxes like:

(1)handle releases (2) handle snapshot (3)suppress pom consistency checks

Should I check on any of these options or uncheck all as it is only going to store the dependencies?

I am using it for the first time so have no idea about it. Also once the local is created please guide me on how to upload the dependencies with minimum effort.

TylerH
  • 20,799
  • 66
  • 75
  • 101
Hangul
  • 19
  • 1
  • 3

1 Answers1

0

JFrog Artifactory comes with predefined repositories for snapshot and release artifacts, you just need to point your project to those repositories.

You need to add this snippet to your project pom.xml:

<distributionManagement>
    <repository>
        <id>id1</id>
        <name>releases</name>
        <url>https://artifactory.url/artifactory/libs-release-local</url>
    </repository>
    <snapshotRepository>
        <id>id2</id>
        <name>snapshots</name>
        <url>https://artifactory.url/artifactory/libs-snapshot-local</url>
    </snapshotRepository>
</distributionManagement>

Then do a mvn deploy and it's done.

About snapshot and release policies (check boxes) they are part of Maven architecture. Snapshots artifacts (e.g. 1.0.0-SNAPSHOT) can have multiple builds of same version, they are overridden in each deploy, while release artifacts (e.g. 1.0.0) are unique and can't be override.

You probably will need to configure credentials for authenticated access. Also is a good practice to use your Artifactory as proxy for artifacts downloads.

Also, you can log in your Artifactory, and use the link Set Me Up, from user menu, to get some configuration snippets.

References:

Claudio Weiler
  • 589
  • 2
  • 15