0

We have recently installed artifactory OSS 6.2.0 and then created the following repositories (with Package Type - Maven).

Local
 - wellows
Remote
 - wellows-remote
Virtual
 - wellows-virtual

And in Virtual Repositories (wellows-virtual), I have included the remote repository which is 'wellows-remote'. I have a maven project and in the distribution tag, I have the following added and as part of the build now the artifacts gets published to the artifactory server. However, I couldn't see my .m2 repository contents anywhere in the Artifactory server. Why so? Am I missing out any configuration here?

<distributionManagement>
    <repository>
        <id>central</id>
        <name>wellow.jrp.com</name>
        <url>http://wellow.jrp.com:8081/artifactory/wellows/</url>
    </repository>
</distributionManagement>
2

Welcome, Vivek 👋🏻

This is not how it works 😀

Your local cache (~/.m2) is not transferred to Artifactory if anything the direction is the other way around (in some point of time you'll see files from Artifactory appear in your local cache).

When you run a Maven build, the configuration you provided in Maven (check the Set Me Up button in Artifactory UI) will make Maven searching for dependencies in the following order:

  • Local cache (~./m2)
  • Artifactory (first local, then remote caches)
  • If Artifactory won't find the artifact, whenever willows-remote is pointing to.

After the artifact is found, it will be saved in Artifactory cache and in a local cache on your machine.

The <distributionManagement> tag you used in your pom.xml is for deploying the artifacts you created when you run a mvn deploy command. It will take the artifact produced (one file, not your entire ~/.m2 cache) and upload it to the repo specified in <distributionManagement>.

1
  • It's a different question (and maybe you should ask it as a separate question), but the answer is import it using the "import" functionality. – JBaruch Jan 24 '19 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.