Dynamic Web Module 3.0 — 3.1

前端 未结 9 1875
谎友^
谎友^ 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 14:09

    I had the same problem and fixed this by editing org.eclipse.wst.common.project.facet.core.xml.

    In this file, I was able to change the following line

    <installed facet="jst.web" version="3.1"/>
    

    back to

    <installed facet="jst.web" version="3.0"/>
    

    That seemed to fix the problem for me.

    0 讨论(0)
  • 2020-12-07 14:10

    I opened the project org.eclipse.wst.common.project.facet.core.xml and first changed then removed line with web module tag. Cleaned project and launched on Tomcat each time but it still didn't run. Returned line (as was) and cleaned project. Opened Tomcat settings in Eclipse and manually added project to Tomcat startup (Right click + Add and Remove). Clicked on project and selected Run on server....and everything was fine.

    0 讨论(0)
  • 2020-12-07 14:11

    1) Go to your project and find ".settings" directory this one
    2) Open file xml named:
    org.eclipse.wst.common.project.facet.core.xml
    3)

    <?xml version="1.0" encoding="UTF-8"?>
        <faceted-project>
        <fixed facet="wst.jsdt.web"/>
        <installed facet="java" version="1.5"/>
        <installed facet="jst.web" version="2.3"/>
        <installed facet="wst.jsdt.web" version="1.0"/>
     </faceted-project>
    

    Change jst.web version to 3.0 and java version to 1.7 or 1.8 (base on your current using jdk version)

    4) Change your web.xml file under WEB-INF directory , please refer to this article:
    https://www.mkyong.com/web-development/the-web-xml-deployment-descriptor-examples/
    5) Go to pom.xml file and paste these lines:

    <build>
        <finalName>YOUR_PROJECT_NAME</finalName>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source> THIS IS YOUR USING JDK's VERSION
                    <target>1.8</target> SAME AS ABOVE
                </configuration>
            </plugin>
        </plugins>
    </build>  
    
    0 讨论(0)
提交回复
热议问题