Changing Dynamic Web Module version in Eclipse Maven Project

后端 未结 3 1710
轮回少年
轮回少年 2020-12-29 06:58

I\'m trying to set up Dynamic Web Module 3.0 in order to support Java 6 development. I\'m getting this error in my Problems tab of eclipse whenever I do Maven > Update

3条回答
  •  死守一世寂寞
    2020-12-29 07:29

    In an our project, we add to change the web.xml root element's declaration, changing from:

    
    

    to:

    
    

    Probably Eclipse were expecting it as satisfying a different Servlet version spec. In our case too, we had neither compile nor runtime problems.

    EDIT: In your case, where you were not using a web.xml file, there was the following pom's dependency which probably was confusing Eclipse's maven plugin:

    
        javax.servlet
        javax.servlet-api
        3.1.0
        provided
    
    

    Change it to "3.0.1". (It turns out that WebApplicationInitializer requires "Servlet 3.0+ environments" and not 3.1+)

提交回复
热议问题