intellij idea导入eclipse创建的maven web项目 jar包导入总是报错

** 软件环境**: spring+springMVC+mybatis+ mysql;
tomcat服务器;
maven项目 eclipse工具运行正常;

            **问题描述:**
            maven的jar包依赖没有导入成功,maven配置正常 沿用了阿里云的中心库eclipse可用;
            报错截图1:

图片说明

nformation:java: Errors occurred while compiling module 'miaolanghzong'
Information:Eclipse compiler 4.7.2 was used to compile java sources
Information:2018/11/12 21:56 - Compilation completed with 133 errors and 418 warnings in 29 s 620 ms
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\totalController\MemberBusinessController.java
    Error:Error:line (1)java: Syntax error on token "Invalid Character", delete this token
    Error:Error:line (13)java: The import javax.servlet.http.HttpServletRequest cannot be resolved
    Error:Error:line (14)java: The import javax.servlet.http.HttpServletResponse cannot be resolved
    Error:Error:line (47)java: The import com.google.gson cannot be resolved
    Error:Error:line (659)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (659)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (623)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (623)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (894)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (894)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (806)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (806)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (198)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (198)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (277)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (277)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (134)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (134)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (460)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (460)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (540)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (540)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (109)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (109)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (411)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (411)java: HttpServletResponse cannot be resolved to a type
    Warning:Warning:line (114)java: The static method sendCode(java.lang.String) from the type com.app.util.Alidayu should be accessed in a static way
    Warning:Warning:line (154)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
    Warning:Warning:line (207)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
    Warning:Warning:line (286)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
    Warning:Warning:line (421)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
    Warning:Warning:line (469)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
    Warning:Warning:line (549)java: The static method md5Encode(java.lang.String) from the type com.app.util.MD5Util should be accessed in a static way
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\common\LoginFilter.java
    Error:Error:line (23)java: Filter cannot be resolved to a type
    Error:Error:line (37)java: ServletException cannot be resolved to a type
    Error:Error:line (36)java: ServletRequest cannot be resolved to a type
    Error:Error:line (36)java: ServletResponse cannot be resolved to a type
    Error:Error:line (37)java: FilterChain cannot be resolved to a type
    Error:Error:line (106)java: ServletException cannot be resolved to a type
    Error:Error:line (106)java: FilterConfig cannot be resolved to a type
    Error:Error:line (7)java: The import javax.servlet.Filter cannot be resolved
    Error:Error:line (8)java: The import javax.servlet.FilterChain cannot be resolved
    Error:Error:line (9)java: The import javax.servlet.FilterConfig cannot be resolved
    Error:Error:line (10)java: The import javax.servlet.ServletException cannot be resolved
    Error:Error:line (11)java: The import javax.servlet.ServletRequest cannot be resolved
    Error:Error:line (12)java: The import javax.servlet.ServletResponse cannot be resolved
    Error:Error:line (13)java: The import javax.servlet.http.HttpServletRequest cannot be resolved
    Error:Error:line (14)java: The import javax.servlet.http.HttpServletResponse cannot be resolved
    Error:Error:line (15)java: The import javax.servlet.http.HttpSession cannot be resolved
    Error:Error:line (24)java: FilterConfig cannot be resolved to a type
    Warning:Warning:line (26)java: java.util.List is a raw type. References to generic type java.util.List<E> should be parameterized
    Warning:Warning:line (28)java: java.util.List is a raw type. References to generic type java.util.List<E> should be parameterized
    Error:Error:line (33)java: FilterConfig cannot be resolved to a type
    Error:Error:line (39)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (39)java: HttpServletRequest cannot be resolved to a type
    Error:Error:line (40)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (40)java: HttpServletResponse cannot be resolved to a type
    Error:Error:line (41)java: HttpSession cannot be resolved to a type
    Error:Error:line (107)java: FilterConfig cannot be resolved to a type
    Error:Error:line (108)java: FilterConfig cannot be resolved to a type
    Error:Error:line (113)java: FilterConfig cannot be resolved to a type
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\impl\MemberDaoImpl.java
    Warning:Warning:line (42)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (63)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (110)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (9)java: The import com.app.bean.Menu is never used
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\impl\EarProblemDaoImpl.java
    Warning:Warning:line (18)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (48)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\impl\BodyConclusionDaoImpl.java
    Warning:Warning:line (25)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (11)java: The import com.app.bean.BodyConclusionWuxing is never used
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\mapper\EarDisease100Mapper.java
    Warning:Warning:line (14)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\BlueToochMacDao.java
    Warning:Warning:line (12)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
    Warning:Warning:line (14)java: java.util.Map is a raw type. References to generic type java.util.Map<K,V> should be parameterized
D:\career\workspaceTest2\erzhentang\src\main\java\com\app\dao\EarScanC 

图片说明

图片说明

图片说明

图片说明

图片说明

图片说明

https://blog.csdn.net/qq_35447305/article/details/67081585

"Invalid Character" 有可能是你的文件编码不匹配造成。确认源文件的编码(中国常用GBK,GB2312,UTF8),然后IDE里面设置成对应的编码。

很明显,缺少servlet的依赖,你可以去maven仓库引用servlet的依赖过来,刷新一下maven就行了