maven Unable to compile class for JSP

昨晚在maven配置上一直报错,总结了遇到的几个大坑

1.检查以下struts.xml中的配置,不要乱从别的地方复制东西,比如

<constant name="struts.devMode" value="true"></constant>    这个东西一定要注释掉

2.在pom.xml中添加依赖,servlet-api和jsp-api的Scope一定要设置成provided,因为依赖范围不同,否则会跟tomcat中自带的jar包冲突

3.默认用tomcat6运行,在pom.xml添加plugin

<plugin>
                <groupId>org.apache.tomcat.maven</groupId>
                <artifactId>tomcat7-maven-plugin</artifactId>
                <version>2.2</version>
                <!-- <configuration>

                    <path></path> 

                    <port></port>

                </configuration> -->

            </plugin>

4.问题解决

猜你喜欢

转载自blog.csdn.net/yamanda/article/details/80135192