0

I have a maven project(say projectA) which produces a tar.gz(zip) file(using assembly plugin).this zip contains some script files.let's say name of zip file is ,patientregistry-v4.tar.gz inside com.mycompany group.

Now ,I am creating a java(spring) project which basically exposes a service and takes maven artifact as parameter(groupid,artifactid,version). So ,I would like to use this configuration to download it from maven repository and then unzip scripts to a folder during runtime. How do I download this maven repository from java ?

Bishu
  • 31
  • 1
  • 4
  • you should deploy your artifact in a repository (nexus/artifactory/archiva....) and when you include as dependency your artifac in your pom.xml and execute mvn install maven download it to .m2 reposirory folder. using maven-dependency-plugin you could copy from .m2 to any folder into your project that you want and unzip. – johnnymnmonic Oct 18 '16 at 21:26
  • well, that makes everything static right ? I would like to get those configurations in a restful service and then use those params to get it from maven rather than defining them in pom. – Bishu Oct 18 '16 at 21:30
  • 1
    Google 'aether' 'maven'. – bmargulies Oct 18 '16 at 21:33
  • 1
    With regard to the comment above, refer to http://stackoverflow.com/questions/10896515/how-do-i-download-a-jar-using-maven-programatically There is an example of how to resolve an artifact here https://github.com/eclipse/aether-demo/blob/master/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/ResolveArtifact.java Clone the repo and play with it :). – Tunaki Oct 18 '16 at 22:49

0 Answers0