javax.servlet-api maven依赖pom.xml怎么写
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javax.servlet-api maven依赖pom.xml怎么写相关的知识,希望对你有一定的参考价值。
<properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.compile.version>1.8</project.compile.version>
<servlet.version>3.1.0</servlet.version>
<jsp.version>2.2</jsp.version>
<jstl.version>1.2.5</jstl.version>
</properties>
<dependencies>
<!-- Web Dependencies -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>$servlet.version</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>$jsp.version</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-compat</artifactId>
<version>$jstl.version</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>$jstl.version</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-jstlel</artifactId>
<version>$jstl.version</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>$jstl.version</version>
</dependency>
</dependencies>
Servlet, JSP和JSTL的。
参考技术A直接使用eclipse的:右键项目名称。maven->Add Dependencies->在搜索栏输入servlet,选中相关依赖即可。
已经在pom.xml中添加了依赖maven dependencies中没有解决方法如下:
1、eclipse菜单 window-> show view –> other –> Maven
2、在打开的窗口里,右键 local repositories –> local repository ,选择 rebuild index
补充下:
1、确认pom.xml文件是正确的
2、确认本地Maven仓库有相同版本的jar包,如果没有,想尽办法down下来吧。
3、Eclipse中,右键工程,Maven->update dependencies,或者update project configuration,或者编码下pom.xml文件,再保存。
maven依赖
//servlet依赖web项目依赖
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
//jsp依赖web项目依赖
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.39</version>
</dependency>
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.1</version>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.1</version>
</dependency>
//test依赖
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>provided</scope>
</dependency>
//jdbc结果集依赖
<dependency>
<groupId>commons-dbutils</groupId>
<artifactId>commons-dbutils</artifactId>
<version>1.7</version>
</dependency>
//jsp标签库EL表达式
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
以上是关于javax.servlet-api maven依赖pom.xml怎么写的主要内容,如果未能解决你的问题,请参考以下文章