Cake Cake - 2 years ago 174
Java Question

Maven - Dependencies in external libraries not copying over to target folder

I'm working on a Java project. I am using Maven to handle the dependencies. I've added a couple of dependencies to the pom.xml file, but when I run the index.html file (in the project), which starts a TomCat server, the TARGET folder that gets generated - does not contain any dependency JAR files.

This is my first time using Maven. I've been looking around for this problem for an hour or two, but I can't seem to find an answer. I've read about plugins, but I don't understand how those work.

I am using IntelliJ IDEA with the Maven plugin.
I've got dependencies in the project, under External Libraries, handled by Maven.

I want the dependency JAR files to be in target > projectname > WEB-INF> lib.


<project xmlns="" xmlns:xsi=""
<!-- When built in OpenShift the 'openshift' profile will be used when
invoking mvn. -->
<!-- Use this profile for any OpenShift specific customization your app
will need. -->
<!-- By default that is to put the resulting archive into the 'webapps'
folder. -->
<!-- -->

Answer Source

The dependencies with you tagged with <provided> are not in the (fat/uber-)jar, as you declared them to be provided by the runtime environment (i.e., your tomcat server).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download