用maven中的pom.xml引入包非常方便,在这我就记录一下我经常用的几个设置,配完pom.xml后只需reimport即可(不断更新中):
junit: 用于测试
<dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.10</version> <scope>test</scope> </dependency>
guava:google用于优化java原生类的扩展包
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>18.0</version> </dependency>
log4j: 日志相关扩展包,用system.out.print和printstacktrace在实际中是不被允许的
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.9</version> </dependency>
servlet:不多说,web相关
<dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency>
mysql-jdbc:连接mysql数据库的,jdbc
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.25</version> </dependency>
fastjson:用于处理json数据
<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId> <version>1.1.37</version> </dependency>
jstl:JSP标准标签库
<dependency> <groupId>jstl</groupId> <artifactId>jstl</artifactId> <version>1.1.0</version> </dependency>
时间: 2024-10-19 20:50:31