I want to create a JAR file of my maven application. So to bundle the dependencies I have used the maven-assembly-plugin. But I want that the dependencies should go the lib/ folder and not anywhere else. My current pom.xml plugin tag is
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
Please suggest. Also is it possible to achieve the same with maven jar plugin.
After the above changes in POM The dependencies get generated in the jar which is generated with suffix 'jar-with-dependencies'. But the dependent jars are scattered I want all those dependent jars to be part of one folder lib similart to WEB-INF/lib for war files. How do I achieve this?
lib
than you need having a assembly descriptor BUT this will not work with a jar cause jar does not support such things. – khmarbaise