Reputation: 14990
I have some of my artifacts(some binary files specific to my projects) stored in an artefactory server. I want to download specific files (whatever that I need for each function or test case) from the Artefactory repository. I can either use Java API or REST API. The source code of the program that uses the artifacts is in Java compiled with maven. In addition to being able to download, I want the download to happen only if the artifact is not already downloaded, ideally using some kind of Checksum. I am a beginner in Java, it would be great if someone can give some guidance to start me off in this direction.
Upvotes: 1
Views: 236
Reputation: 23
For each artifact you want to use from your artefactory server, you need to know the details of the artifact like groupId, artifactId, version. Then add them to your pom.xml as a dependency.
For example, to add junit as a dependency you need to have groupId, artifactId, version of junit library. Add it as following with scope as test.
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
One more thing is don't forgot to add artefactory server(repository server) in the repositories of pom.xml if it is not added yet.
Upvotes: 1