简体   繁体   中英

How can eclipse find 'javax.servlet' when using the gradle with plugins 'war' and 'jetty'

This must be very basic. But I just don't know how to make it work.

I'm following the book "Gradle in Action". When making the webapp the following is put in the build.gradle file

dependencies {
    providedCompile 'javax.servlet:servlet-api:2.5',
            'javax.servlet.jsp:jsp-api:2.1'
    runtime 'javax.servlet:jstl:1.1.2',
            'taglibs:standard:1.1.2'
}

I'm using eclipse. But it seems eclipse can't find javax.servlet . In cmd , I'm still able to run gradle jettyRun . Am I missing something? Thanks ahead!

apply plugin: 'eclipse-wtp'

is probably missing in your build.gradle . I suppose you have WTP (Web Tools Platform) plugins installed into your Eclipse.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM