1

I need to copy and zip all of the libraries I used in a specific intellij-project. I did some Arquillian testing and therefore I can't quite copy them all by hand. I created the project using maven and downloaded all the dependencies this way.

I don't have to unpack them or something, I really just want to zip them all together. The problem is that I did not find any place where only those libraries are or a way to export all used libraries to somewhere else. The only place where all of the used libraries are is my local maven repository (I guess) but there are more than the ones I used in this project so I can't just copy the local repo. Is there any way to do what I try to achieve?

Patrick Malik
  • 185
  • 1
  • 11
  • only scope=compile libraries or other scopes as well? In the first case you could just get them from your jar/war/ear. – Pieter De Bie Feb 08 '17 at 09:26
  • basically every scope, so every used scope in the whole project. I'm trying now to delete the local repository and rebuild the project. Afterwards I should only have the necessary dependencies in the local repo – Patrick Malik Feb 08 '17 at 09:31
  • 1
    Out of interest: why do you want to do this? This sounds a bit like an A B problem – Pieter De Bie Feb 08 '17 at 09:43
  • 1
    I wouldnt do it this way if I didnt have to.. I dont want to do it either but there is unfortunately no other way ^^ The project I need it for cannot use maven or something else similar.. – Patrick Malik Feb 08 '17 at 09:45
  • I would like to hear why your Maven dependencies are _only_ in your local repository. Why can't they just import your maven project? – Thorbjørn Ravn Andersen Feb 08 '17 at 10:22
  • I think I dont quite get the question tbh – Patrick Malik Feb 09 '17 at 06:44

1 Answers1

2

Copy using https://maven.apache.org/plugins/maven-dependency-plugin/copy-dependencies-mojo.html, for instance to a target/ folder. You can then either teach maven to zip it, or do it by hand.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347