欢迎交流
1.PomDependies
| <dependencies> |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.5</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet.jsp</groupId> |
| <artifactId>jsp-api</artifactId> |
| <version>2.1.3-b06</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-orm</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>com.mchange</groupId> |
| <artifactId>c3p0</artifactId> |
| <version>0.9.2</version> |
| </dependency> |
| <dependency> |
| <groupId>cglib</groupId> |
| <artifactId>cglib</artifactId> |
| <version>2.2</version> |
| </dependency> |
| <dependency> |
| <groupId>org.aspectj</groupId> |
| <artifactId>aspectjweaver</artifactId> |
| <version>1.6.8</version> |
| </dependency> |
| |
| |
| |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.2.8</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>1.2.2</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>1.2.17</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.37</version> |
| </dependency> |
| <dependency> |
| <groupId>jstl</groupId> |
| <artifactId>jstl</artifactId> |
| <version>1.2</version> |
| </dependency> |
| |
| |
| |
| |
| <dependency> |
| <groupId>net.sf.ehcache</groupId> |
| <artifactId>ehcache</artifactId> |
| <version>1.6.2</version> |
| </dependency> |
| |
| |
| |
| <dependency> |
| <groupId>org.quartz-scheduler</groupId> |
| <artifactId>quartz</artifactId> |
| <version>1.8.5</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context-support</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-collections</groupId> |
| <artifactId>commons-collections</artifactId> |
| <version>3.1</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.codehaus.jackson</groupId> |
| <artifactId>jackson-mapper-asl</artifactId> |
| <version>1.9.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.poi</groupId> |
| <artifactId>poi</artifactId> |
| <version>3.9</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.jfree</groupId> |
| <artifactId>jfreechart</artifactId> |
| <version>1.0.19</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-fileupload</groupId> |
| <artifactId>commons-fileupload</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.freemarker</groupId> |
| <artifactId>freemarker</artifactId> |
| <version>2.3.19</version> |
| </dependency> |
| <--!activiti流程框架 !--> |
| <dependency> |
| <groupId>org.activiti</groupId> |
| <artifactId>activiti-engine</artifactId> |
| <version>5.15.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.activiti</groupId> |
| <artifactId>activiti-spring</artifactId> |
| <version>5.15.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-email</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.activiti</groupId> |
| <artifactId>activiti-explorer</artifactId> |
| <version>5.15.1</version> |
| <exclusions> |
| <exclusion> |
| <artifactId>groovy-all</artifactId> |
| <groupId>org.codehaus.groovy</groupId> |
| </exclusion> |
| </exclusions> |
| </dependency> |
| </dependencies> |
上面是不全的依赖,可以自己copy------/|\
项目中比较全的应用的pom:-----\|/
| <dependencies> |
| <!-- <dependency> |
| <groupId>redis.clients</groupId> |
| <artifactId>jedis</artifactId> |
| <version>2.9.0</version> |
| </dependency> --> |
| |
| <dependency> |
| <groupId>org.apache.solr</groupId> |
| <artifactId>solr-solrj</artifactId> |
| <version>4.10.1</version> |
| </dependency> |
| <!-- 1.连接池 --> |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.37</version> |
| </dependency> |
| <dependency> |
| <groupId>com.mchange</groupId> |
| <artifactId>c3p0</artifactId> |
| <version>0.9.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-dbcp</groupId> |
| <artifactId>commons-dbcp</artifactId> |
| <version>1.4</version> |
| </dependency> |
| |
| <!-- 2.Spring --> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-orm</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| <!-- 3.MyBatis --> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.2.8</version> |
| </dependency> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>1.2.2</version> |
| </dependency> |
| |
| <!-- 4.SpringMVC --> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| <!-- 5.辅助 --> |
| <dependency> |
| <groupId>jstl</groupId> |
| <artifactId>jstl</artifactId> |
| <version>1.2</version> |
| </dependency> |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>1.2.17</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>cglib</groupId> |
| <artifactId>cglib</artifactId> |
| <version>2.2</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-fileupload</groupId> |
| <artifactId>commons-fileupload</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>com.google.code.gson</groupId> |
| <artifactId>gson</artifactId> |
| <version>2.2.4</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.5</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet.jsp</groupId> |
| <artifactId>jsp-api</artifactId> |
| <version>2.1.3-b06</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.codehaus.jackson</groupId> |
| <artifactId>jackson-mapper-asl</artifactId> |
| <version>1.9.11</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-collections</groupId> |
| <artifactId>commons-collections</artifactId> |
| <version>3.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-lang3</artifactId> |
| <version>3.3.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>javax.mail</groupId> |
| <artifactId>mail</artifactId> |
| <version>1.4.7</version> |
| </dependency> |
| <dependency> |
| <groupId>net.sf.json-lib</groupId> |
| <artifactId>json-lib</artifactId> |
| <version>2.4</version> |
| <classifier>jdk15</classifier> |
| </dependency> |
| |
| |
| </dependencies> |
--slorpom依赖
| <dependency> |
| <groupId>org.apache.solr</groupId> |
| <artifactId>solr-solrj</artifactId> |
| <version>4.10.1</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-logging</groupId> |
| <artifactId>commons-logging</artifactId> |
| <version>1.1.3</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.commons</groupId> |
| <artifactId>commons-lang3</artifactId> |
| <version>3.3.2</version> |
| </dependency> |
| <dependency> |
| <groupId>com.fasterxml.jackson.core</groupId> |
| <artifactId>jackson-databind</artifactId> |
| <version>2.4.2</version> |
| </dependency> |
--managerPom依赖
| <dependencies> |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.37</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>com.mchange</groupId> |
| <artifactId>c3p0</artifactId> |
| <version>0.9.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-dbcp</groupId> |
| <artifactId>commons-dbcp</artifactId> |
| <version>1.4</version> |
| </dependency> |
| |
| |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.2.8</version> |
| </dependency> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>1.2.2</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-orm</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>jstl</groupId> |
| <artifactId>jstl</artifactId> |
| <version>1.2</version> |
| </dependency> |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>1.2.17</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>cglib</groupId> |
| <artifactId>cglib</artifactId> |
| <version>2.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-fileupload</groupId> |
| <artifactId>commons-fileupload</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>com.google.code.gson</groupId> |
| <artifactId>gson</artifactId> |
| <version>2.2.4</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.5</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet.jsp</groupId> |
| <artifactId>jsp-api</artifactId> |
| <version>2.1.3-b06</version> |
| <scope>provided</scope> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.codehaus.jackson</groupId> |
| <artifactId>jackson-mapper-asl</artifactId> |
| <version>1.9.11</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-collections</groupId> |
| <artifactId>commons-collections</artifactId> |
| <version>3.1</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>redis.clients</groupId> |
| <artifactId>jedis</artifactId> |
| <version>2.9.0</version> |
| </dependency> |
| </dependencies> |
--salePom依赖
| <dependencies> |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.37</version> |
| </dependency> |
| <dependency> |
| <groupId>com.mchange</groupId> |
| <artifactId>c3p0</artifactId> |
| <version>0.9.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>commons-dbcp</groupId> |
| <artifactId>commons-dbcp</artifactId> |
| <version>1.4</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-orm</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.2.8</version> |
| </dependency> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>1.2.2</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-webmvc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>jstl</groupId> |
| <artifactId>jstl</artifactId> |
| <version>1.2</version> |
| </dependency> |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>1.2.17</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>cglib</groupId> |
| <artifactId>cglib</artifactId> |
| <version>2.2</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-fileupload</groupId> |
| <artifactId>commons-fileupload</artifactId> |
| <version>1.3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>com.google.code.gson</groupId> |
| <artifactId>gson</artifactId> |
| <version>2.2.4</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.5</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>javax.servlet.jsp</groupId> |
| <artifactId>jsp-api</artifactId> |
| <version>2.1.3-b06</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>org.codehaus.jackson</groupId> |
| <artifactId>jackson-mapper-asl</artifactId> |
| <version>1.9.11</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-collections</groupId> |
| <artifactId>commons-collections</artifactId> |
| <version>3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>javax.mail</groupId> |
| <artifactId>mail</artifactId> |
| <version>1.4.7</version> |
| </dependency> |
| <dependency> |
| <groupId>net.sf.json-lib</groupId> |
| <artifactId>json-lib</artifactId> |
| <version>2.4</version> |
| <classifier>jdk15</classifier> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-frontend-jaxws</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-transports-http</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-ws-security</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.ws.security</groupId> |
| <artifactId>wss4j</artifactId> |
| <version>1.5.2</version> |
| </dependency> |
| |
| </dependencies> |
--cxfPom依赖
| <dependencies> |
| |
| <dependency> |
| <groupId>mysql</groupId> |
| <artifactId>mysql-connector-java</artifactId> |
| <version>5.1.37</version> |
| </dependency> |
| <dependency> |
| <groupId>commons-dbcp</groupId> |
| <artifactId>commons-dbcp</artifactId> |
| <version>1.4</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis</artifactId> |
| <version>3.2.8</version> |
| </dependency> |
| <dependency> |
| <groupId>org.mybatis</groupId> |
| <artifactId>mybatis-spring</artifactId> |
| <version>1.2.2</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-core</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-context</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-jdbc</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-orm</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-web</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>javax.servlet</groupId> |
| <artifactId>servlet-api</artifactId> |
| <version>2.5</version> |
| <scope>provided</scope> |
| </dependency> |
| <dependency> |
| <groupId>commons-collections</groupId> |
| <artifactId>commons-collections</artifactId> |
| <version>3.1</version> |
| </dependency> |
| <dependency> |
| <groupId>log4j</groupId> |
| <artifactId>log4j</artifactId> |
| <version>1.2.17</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-api</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| <dependency> |
| <groupId>org.slf4j</groupId> |
| <artifactId>slf4j-log4j12</artifactId> |
| <version>1.7.7</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-frontend-jaxws</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-transports-http</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-ws-security</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| |
| <dependency> |
| <groupId>org.apache.ws.security</groupId> |
| <artifactId>wss4j</artifactId> |
| <version>1.5.2</version> |
| </dependency> |
| |
| |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-frontend-jaxrs</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| <dependency> |
| <groupId>org.apache.cxf</groupId> |
| <artifactId>cxf-rt-transports-http-jetty</artifactId> |
| <version>3.0.5</version> |
| </dependency> |
| |
| </dependencies> |
--事务依赖
| |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-tx</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.springframework</groupId> |
| <artifactId>spring-aspects</artifactId> |
| <version>4.0.0.RELEASE</version> |
| </dependency> |
| <dependency> |
| <groupId>org.aspectj</groupId> |
| <artifactId>aspectjweaver</artifactId> |
| <version>1.6.8</version> |
| </dependency> |
| <dependency> |
| <groupId>aopalliance</groupId> |
| <artifactId>aopalliance</artifactId> |
| <version>1.0</version> |
| </dependency> |
2.SpringSetting
| <?xml version="1.0" encoding="UTF-8"?> |
| <beans xmlns="http://www.springframework.org/schema/beans" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" |
| xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:aop="http://www.springframework.org/schema/aop" |
| xmlns:tx="http://www.springframework.org/schema/tx" |
| |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans |
| http://www.springframework.org/schema/beans/spring-beans.xsd |
| http://www.springframework.org/schema/context |
| http://www.springframework.org/schema/context/spring-context.xsd |
| http://www.springframework.org/schema/jdbc |
| http://www.springframework.org/schema/jdbc/spring-jdbc.xsd |
| http://www.springframework.org/schema/aop |
| http://www.springframework.org/schema/aop/spring-aop.xsd |
| http://www.springframework.org/schema/tx |
| http://www.springframework.org/schema/tx/spring-tx.xsd |
| "> |
| |
| <context:property-placeholder location="classpath:dbConfig.properties" /> |
| |
| <context:component-scan base-package="com.atguigu.service" |
| use-default-filters="false"> |
| <context:include-filter type="annotation" |
| expression="org.springframework.stereotype.Service" /> |
| </context:component-scan> |
| |
| <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> |
| <property name="driverClassName" value="${driverClassName}" /> |
| <property name="url" value="${url}" /> |
| <property name="username" value="${jdbc.username}" /> |
| <property name="password" value="${jdbc.password}" /> |
| </bean> |
| |
| <bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean"> |
| <property name="dataSource" ref="dataSource" /> |
| <property name="configLocation" value="classpath:mybatis-config.xml" /> |
| </bean> |
| |
| <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> |
| <property name="basePackage" value="com.atguigu.mapper" /> |
| <property name="sqlSessionFactoryBeanName" value="sqlSessionFactoryBean" /> |
| </bean> |
| |
| </beans> |
| 添加事务支持 |
| <beans> |
| ... |
| <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" > |
| <property name="dataSource" ref="dataSource"/> |
| </bean> |
| <tx:advice id="transactionAdvice" transaction-manager="transactionManager" > |
| <tx:attributes> |
| <tx:method name="*" propagation="REQUIRED" isolation="DEFAULT" rollback-for="java.lang.Exception" /> |
| <tx:method name="query*" read-only="true" /> |
| </tx:attributes> |
| </tx:advice> |
| <aop:config> |
| <aop:advisor advice-ref="transactionAdvice" pointcut="execution(* com.atguigu..*Service.*(..))"/> |
| </aop:config> |
| ... |
| </beans> |
3.SpringMvcSetting
| <?xml version="1.0" encoding="UTF-8"?> |
| <beans xmlns="http://www.springframework.org/schema/beans" |
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns:context="http://www.springframework.org/schema/context" |
| xmlns:mvc="http://www.springframework.org/schema/mvc" |
| xsi:schemaLocation=" |
| http://www.springframework.org/schema/beans |
| http://www.springframework.org/schema/beans/spring-beans.xsd |
| http://www.springframework.org/schema/context |
| http://www.springframework.org/schema/context/spring-context.xsd |
| http://www.springframework.org/schema/mvc |
| http://www.springframework.org/schema/mvc/spring-mvc.xsd"> |
| |
| |
| |
| <context:component-scan |
| base-package="com.atguigu.controller" use-default-filters="false"> |
| <context:include-filter type="annotation" |
| expression="org.springframework.stereotype.Controller" /> |
| <context:include-filter type="annotation" |
| expression="org.springframework.web.bind.annotation.ControllerAdvice" /> |
| </context:component-scan> |
| |
| |
| <bean |
| class="org.springframework.web.servlet.view.InternalResourceViewResolver"> |
| <property name="prefix" value="/WEB-INF/"></property> |
| <property name="suffix" value=".jsp"></property> |
| </bean> |
| |
| |
| <bean id="multipartResolver" |
| class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> |
| <property name="defaultEncoding" value="UTF-8" /> |
| |
| <property name="maxUploadSize" value="10240000" /> |
| </bean> |
| |
| <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> |
| <property name="messageConverters"> |
| <list> |
| <bean |
| class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"> |
| <property name="supportedMediaTypes"> |
| <list> |
| <value>application/json;charset=UTF-8</value> |
| </list> |
| </property> |
| </bean> |
| </list> |
| </property> |
| </bean> |
| |
| <mvc:annotation-driven /> |
| <mvc:default-servlet-handler /> |
| |
| </beans> |
4.MyBatisSetting
| <beans> |
| //注意文件的地址集成mybatis |
| <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean" > |
| <property name="configLocation" value="classpath:config.xml" /> |
| <property name="dataSource" ref="dataSource" /> |
| <property name="mapperLocations" > |
| <list> |
| <value>classpath*:mapper-*.xml</value> |
| </list> |
| </property> |
| </bean> |
| ... |
| <bean id="mapperScannerConfigurer" class="org.mybatis.spring.mapper.MapperScannerConfigurer" > |
| <property name="basePackage" value="com.atguigu.atcrowdfunding.**.dao" /> |
| </bean> |
| ... |
| </beans> |
| <?xml version="1.0" encoding="UTF-8"?> |
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| <mapper namespace="xxx.XXDao" > |
| ... |
| </mapper |
| <?xml version="1.0" encoding="UTF-8" ?> |
| <!DOCTYPE configuration |
| PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
| "http://mybatis.org/dtd/mybatis-3-config.dtd"> |
| <configuration> |
| <mappers> |
| </mappers> |
| |
| </configuration> |
5.DbSetting
| #oracle.jdbc.driver.OracleDriver |
| #jdbc:oracle:thin:@localhost:1521:v6orcl |
| driverClassName=com.mysql.jdbc.Driver |
| url=jdbc:mysql://localhost:3306/mall_test?useUnicode=true&characterEncoding=UTF8 |
| jdbc.username=root |
| jdbc.password=root |
6.Log4jSetting
| log4j.rootLogger=DEBUG, b |
| log4j.appender.b=org.apache.log4j.ConsoleAppender |
| log4j.appender.b.layout=org.apache.log4j.PatternLayout |
| log4j.appender.b.layout.ConversionPattern=%5p %m%n |
| # |
| log4j.logger.org.mybatis=DEBUG |
| #log4j.logger.org.apache.struts2=on |
| #log4j.logger.com.opensymphony.xwork2=off |
| log4j.logger.com.ibatis=on |
| log4j.logger.org.apache.cxf=off |
| #log4j.logger.org.hibernate=OFF |
| log4j.logger.org.springframework=off |
| #log4j.logger.com.opensymphony.xwork2=ERROR |
7.web.xml
| <?xml version="1.0" encoding="UTF-8"?> |
| <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| xmlns="http://java.sun.com/xml/ns/javaee" |
| xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
| id="WebApp_ID" version="2.5"> |
| <display-name>business_sale</display-name> |
| <welcome-file-list> |
| <welcome-file>index.html</welcome-file> |
| <welcome-file>index.htm</welcome-file> |
| <welcome-file>index.jsp</welcome-file> |
| <welcome-file>default.html</welcome-file> |
| <welcome-file>default.htm</welcome-file> |
| <welcome-file>default.jsp</welcome-file> |
| </welcome-file-list> |
| <context-param> |
| <param-name>contextConfigLocation</param-name> |
| <param-value>classpath:applicationContext.xml</param-value> |
| </context-param> |
| <listener> |
| <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
| </listener> |
| <filter> |
| <filter-name>encodingFilter</filter-name> |
| <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> |
| <init-param> |
| <param-name>encoding</param-name> |
| <param-value>UTF-8</param-value> |
| </init-param> |
| <init-param> |
| <param-name>forceEncoding</param-name> |
| <param-value>true</param-value> |
| </init-param> |
| </filter> |
| <filter-mapping> |
| <filter-name>encodingFilter</filter-name> |
| <url-pattern>/*</url-pattern> |
| </filter-mapping> |
| <servlet> |
| <servlet-name>mvc</servlet-name> |
| <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
| <init-param> |
| <param-name>contextConfigLocation</param-name> |
| <param-value>classpath:spring-mvc.xml</param-value> |
| </init-param> |
| <load-on-startup>1</load-on-startup> |
| </servlet> |
| <servlet-mapping> |
| <servlet-name>mvc</servlet-name> |
| <url-pattern>*.do</url-pattern> |
| </servlet-mapping> |
| </web-app> |
8.WebSetting
| <context-param> |
| <param-name>contextConfigLocation</param-name> |
| <param-value>classpath:applicationContext.xml</param-value> |
| </context-param> |
| <listener> |
| <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> |
| </listener> |
| |
| |
| <filter> |
| <filter-name>encodingFilter</filter-name> |
| <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> |
| <init-param> |
| <param-name>encoding</param-name> |
| <param-value>utf-8</param-value> |
| </init-param> |
| <init-param> |
| <param-name>forceEncoding</param-name> |
| <param-value>true</param-value> |
| </init-param> |
| </filter> |
| <filter-mapping> |
| <filter-name>encodingFilter</filter-name> |
| <url-pattern>/*</url-pattern> |
| </filter-mapping> |
| |
| <servlet> |
| <servlet-name>mvc</servlet-name> |
| <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> |
| <init-param> |
| <param-name>contextConfigLocation</param-name> |
| <param-value>classpath:spring-mvc.xml</param-value> |
| </init-param> |
| </servlet> |
| |
| <servlet-mapping> |
| <servlet-name>mvc</servlet-name> |
| <url-pattern>*.do</url-pattern> |
| </servlet-mapping> |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)