从2014年12月开始,一直在研究Spring的框架;并且在我们新的开发框架中得到应用;这篇文章记录了这段时间的成长记录,仅此先给共同成长的小白。
为了简单,我们选择使用maven来构建项目,通过maven可以控制引入jar的版本,大大简化了jar包的管理工作,废话不多说,创建一个项目
一、创建一个新项目
1、创建maven项目
2、选择 maven-archetype-webapp
3、填写groupId、artifactId、package
项目目录:
二、项目创建完成后修改默认的jdk、编译器等默认属性,我的项目选择的是jdk7
3、 引入Spring的jar
Xml代码
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring.version>3.2.12.RELEASE</spring.version>
<tddl.version>3.0.1.5.taobaocode-SNAPSHOT</tddl.version>
<druid.version>0.2.3</druid.version>
<cglib.version>2.1_3</cglib.version>
<aspectj.version>1.6.6</aspectj.version>
<jms.version>2.0</jms.version>
<jackson.version>1.9.5</jackson.version>
<poi.version>3.10.1</poi.version>
<mail.version>1.4.3</mail.version>
<atomikos.version>3.9.3</atomikos.version>
<mysql.version>5.1.34</mysql.version>
<redis.version>2.1.0</redis.version>
<jta.version>1.1</jta.version>
<activemq.version>5.10.0</activemq.version>
<servlet-api.version>5.5.23</servlet-api.version>
<fileupload.version>1.3.1</fileupload.version>
<fastjson.version>1.1.15</fastjson.version>
<json-lib.version>2.4</json-lib.version>
<jaxb-api.version>2.2.11</jaxb-api.version>
<jaxb-impl.version>2.1</jaxb-impl.version>
<woodstox.version>4.1.5</woodstox.version>
<activation.version>1.1.1</activation.version>
<testng.version>6.8.13</testng.version>
<mockito.version>1.10.18</mockito.version>
<unitils.version>3.4.2</unitils.version>
<Java.version>1.7</java.version>
<jodd.version>3.3.8</jodd.version>
<jstl.version>1.2</jstl.version>
<file.encoding>utf-8</file.encoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- JSTL -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>${jstl.version}</version>
</dependency>
<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jms</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>javax.jms-api</artifactId>
<version>${jms.version}</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
<version>${mail.version}</version>
</dependency>