Eclipse: How can I have gradle dependencies deployed to Tomcat


April 2019


302 time


I'm creating a web project using Gradle (buildship) in Eclipse (WTP). I've put the libraries I need as "implementation" dependencies in my build.gradle, however they are not copied to Tomcat when I try to run the project from within Eclipse. When I build the WAR file (with gradle war), however, all the jar files are there.

I can't find anywhere the solution for this. It's beeing awful to manually (and redundantly) copying every jar and its dependency to WEB-INF/libs just to be able to run the app from Eclipse).

2 answers


I've found a workaround here:

It's adding this to build.gradle:

eclipse {
    wtp {
        component {
            libConfigurations += [configurations.runtimeClasspath]

With this everything gets properly deployed.


Gradle 5.3 has just been released and includes a fix for this issue and the hack above is not needed anymore.


The only thing that worked for me was changing

dependencies {
    implementation group: 'org.projectlombok', name: 'lombok', version: '1.18.4'


dependencies {
    compile group: 'org.projectlombok', name: 'lombok', version: '1.18.4'