tomcat maven 插件配置
在maven框架中,如果需要直接运行tomcat,需要做如下步骤:Pom文件中添加tomcat plugin
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
在build goals 里面填写
clean tomcat:run
这时候tomcat一般可以启动,访问主页,如果报如下错
org.apache.jasper.JasperException: Unable to compile class for JSP:
只需要在pom文件中添加servlet的依赖
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
页:
[1]