JavaServer Faces 2.2 requires Dynamic Web Module 2.5 or newer

来源:互联网 发布:mac草图大师总是卡 编辑:程序博客网 时间:2024/05/22 11:55

统一解决Maven创建动态Web项目后产生的版本不匹配。

1:问题如下

2:解决方法

  1. Go to project Build Path and change the Java Library version to 1.7

这里写图片描述

删除原先的低版本JRE

这里写图片描述

增加系统默认1.7版本的JRE

这里写图片描述

这里写图片描述

这里写图片描述

  1. Eclipse Preferences -> Java -> Compilre -> Change compliance level to 1.7

    这里写图片描述

  2. 在项目上单机右键 -> Properties -> Project Facets

  3. 取消选中 Dynamic Web Module 状态,点击 Apply

  4. 将 Java facet 版本变为 1.7 ,点击 Apply

    这里写图片描述

  5. 将 Dyanmic Web Module 版本更改为3.0, 点击 Apply.
    这里写图片描述

  6. 在 Pom 中添加下面 build 配置。

<build>    <finalName>项目名称</finalName>    <plugins>        <plugin>            <groupId>org.apache.maven.plugins</groupId>            <artifactId>maven-compiler-plugin</artifactId>            <version>2.3.2</version>            <configuration>                <source>1.7</source>                <target>1.7</target>            </configuration>        </plugin>    </plugins></build>
  1. maven->update
    这里写图片描述
    注意

一定最后要将Java Server 和 JAX-RS勾选上,不然项目中缺失web.xml

这里写图片描述

1 1