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.
Asked
Active
Viewed 1,300 times
2
-
you have a maven jar project and you want jar out of it to reuse it in non maven project ? – jmj Dec 17 '14 at 13:23
-
yes that what I want.. – Shekhar Khairnar Dec 17 '14 at 13:24
-
you already have project and you just need jar out of it ? – jmj Dec 17 '14 at 13:26
-
yes means whatever jar's used in my maven project I want that all jars so that I can include them in lib of other project – Shekhar Khairnar Dec 17 '14 at 13:27
1 Answers
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
-
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
tag it's give me error as mention above near tag in eclipse – Shekhar Khairnar Dec 17 '14 at 13:57