This sounds like a similar problem I had with the eclipse-wtp plugin. Check out the forum topic “Eclipse - Glassfish - Struts 2.x” Basically I was using Gradle to manage all my jar dependencies, but I wanted to run the web application through Eclipse using the Glassfish server.
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
// ...
}
eclipse {
wtp {
component {
resource deployPath: '/', sourcePath: '/WebContent'
resource deployPath: '/WEB-INF/classes', sourcePath: '/src'
}
}
}
sourceSets {
main {
java {
srcDirs "src"
}
resources {
srcDir "src"
}
}
}
Next run the eclipse task and then import the project into Eclipse. Right clicked on the project, select Project Facets and click on the Runtimes tab. Put a check mark on the GlassFish runtime. Select the “Default Configuration for GlassFish” from the Configuration drop down box and then clicked ok.