Dynamic Web Module 3.0 — 3.1

前端 未结 9 1900
谎友^
谎友^ 2020-12-07 13:47

I have a mavenized codebased configured Spring 3.2.4 web app. When I build the app with Maven/pom.xml first I got an error that web.xml is missing. first I tried to create

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-07 13:56

    If you want to use version 3.1 you need to use the following schema:

    • http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd

    Note that 3.0 and 3.1 are different: in 3.1 there's no Sun mentioned, so simply changing 3_0.xsd to 3_1.xsd won't work.

    This is how it should look like:

    
    
    
    
    

    Also, make sure you're depending on the latest versions in your pom.xml. That is,

    
        org.apache.maven.plugins
        maven-war-plugin
        2.6
        
            ...
        
    
    

    and

    
        javax.servlet
        javax.servlet-api
        3.1.0
        provided
    
    

    Finally, you should compile with Java 7 or 8:

    
        org.apache.maven.plugins
        maven-compiler-plugin
        3.3
        
            1.7
            1.7
        
    
    

提交回复
热议问题