2

Hi I am developing a web application with maven structure so the maven create Maven Dependencies library to include the jar. My question is I need this library or jars in it so that I can use them to another non maven project like java project archetype in eclipse.

Shekhar Khairnar
  • 2,643
  • 3
  • 26
  • 44

1 Answers1

1

You need to configure your pom.xml to create a fat jar (jar including all of your dependencies inside jar) and then run mvn clean package

Community
  • 1
  • 1
jmj
  • 237,923
  • 42
  • 401
  • 438
  • in that link you mention one maven plugin if I understood correct it will create jar for that maven project itself right? – Shekhar Khairnar Dec 17 '14 at 13:33
  • yes including all of its dependencies inside jar, for example if you have dependency of `log4j` inside your project's `pom.xml` fat jar will have classes for your project + log4j jar in it – jmj Dec 17 '14 at 13:34
  • what if I only need log4j jar and not classes for my project? – Shekhar Khairnar Dec 17 '14 at 13:35
  • You will need to use maven dependency plugin, [see reference](http://stackoverflow.com/a/996915/260990) – jmj Dec 17 '14 at 13:37
  • maven-dependency-plugin (goals "copy-dependencies", "unpack") is not supported by m2e this error I got any suggestions..? – Shekhar Khairnar Dec 17 '14 at 13:49
  • I just added that plugin from the and added to my pom file in tag it's give me error as mention above near tag in eclipse – Shekhar Khairnar Dec 17 '14 at 13:57