1 1.X 版本与spring结合使用实例

1.1 常用maven管理 pom.xml文件

  1 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  3     <modelVersion>4.0.0</modelVersion>
  4     <groupId>com.kevin.quartz</groupId>
  5     <artifactId>quartz</artifactId>
  6     <packaging>war</packaging>
  7     <version>1.0</version>
  8     <name>quartz1.x</name>
  9     <url>http://maven.apache.org</url>
 10 
 11     <properties>
 12         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 13         <spring.version>3.2.14.RELEASE</spring.version>
 14     </properties>
 15 
 16     <build>
 17         <plugins>
 18             <plugin>
 19                 <groupId>org.apache.maven.plugins</groupId>
 20                 <artifactId>maven-war-plugin</artifactId>
 21                 <configuration>
 22                     <attachClasses>false</attachClasses>
 23                 </configuration>
 24             </plugin>
 25 
 26             <!-- 生成源代码的jar包 -->
 27             <plugin>
 28                 <groupId>org.apache.maven.plugins</groupId>
 29                 <artifactId>maven-source-plugin</artifactId>
 30                 <executions>
 31                     <execution>
 32                         <id>attach-sources</id>
 33                         <goals>
 34                             <goal>jar-no-fork</goal>
 35                         </goals>
 36                     </execution>
 37                 </executions>
 38             </plugin>
 39 
 40             <plugin>
 41                 <groupId>org.apache.maven.plugins</groupId>
 42                 <artifactId>maven-compiler-plugin</artifactId>
 43                 <configuration>
 44                     <source>1.6</source>
 45                     <target>1.6</target>
 46                 </configuration>
 47             </plugin>
 48         </plugins>
 49         <!-- 生成jar或war包的名字 -->
 50         <finalName>${artifactId}</finalName>
 51     </build>
 52 
 53     <dependencies>
 54 
 55         <dependency>
 56             <groupId>javax.servlet</groupId>
 57             <artifactId>servlet-api</artifactId>
 58             <version>2.5</version>
 59             <scope>provided</scope>
 60         </dependency>
 61         <dependency>
 62             <groupId>junit</groupId>
 63             <artifactId>junit</artifactId>
 64             <version>4.10</version>
 65             <scope>test</scope>
 66         </dependency>
 67 
 68         <dependency>
 69             <groupId>log4j</groupId>
 70             <artifactId>log4j</artifactId>
 71             <version>1.2.16</version>
 72         </dependency>
 73 
 74         <!-- spring framework start -->
 75         <dependency>
 76             <groupId>org.springframework</groupId>
 77             <artifactId>spring-core</artifactId>
 78             <version>${spring.version}</version>
 79         </dependency>
 80         <dependency>
 81             <groupId>org.springframework</groupId>
 82             <artifactId>spring-context</artifactId>
 83             <version>${spring.version}</version>
 84         </dependency>
 85         <dependency>
 86             <groupId>org.springframework</groupId>
 87             <artifactId>spring-beans</artifactId>
 88             <version>${spring.version}</version>
 89         </dependency>
 90         <dependency>
 91             <groupId>org.springframework</groupId>
 92             <artifactId>spring-web</artifactId>
 93             <version>${spring.version}</version>
 94         </dependency>
 95         <dependency>
 96             <groupId>org.springframework</groupId>
 97             <artifactId>spring-webmvc</artifactId>
 98             <version>${spring.version}</version>
 99         </dependency>
100         <dependency>
101             <groupId>org.springframework</groupId>
102             <artifactId>spring-aop</artifactId>
103             <version>${spring.version}</version>
104         </dependency>
105         <dependency>
106             <groupId>org.springframework</groupId>
107             <artifactId>spring-jdbc</artifactId>
108             <version>${spring.version}</version>
109         </dependency>
110         <dependency>
111             <groupId>org.springframework</groupId>
112             <artifactId>spring-tx</artifactId>
113             <version>${spring.version}</version>
114         </dependency>
115         <dependency>
116             <groupId>org.springframework</groupId>
117             <artifactId>spring-orm</artifactId>
118             <version>${spring.version}</version>
119         </dependency>
120         <dependency>
121             <groupId>org.springframework</groupId>
122             <artifactId>spring-context-support</artifactId>
123             <version>${spring.version}</version>
124         </dependency>
125         <dependency>
126             <groupId>org.springframework</groupId>
127             <artifactId>spring-expression</artifactId>
128             <version>${spring.version}</version>
129         </dependency>
130         <dependency>
131             <groupId>org.springframework</groupId>
132             <artifactId>spring-test</artifactId>
133             <version>${spring.version}</version>
134         </dependency>
135         <dependency>
136             <groupId>org.springframework</groupId>
137             <artifactId>spring-aspects</artifactId>
138             <version>${spring.version}</version>
139         </dependency>
140         <dependency>
141             <groupId>aopalliance</groupId>
142             <artifactId>aopalliance</artifactId>
143             <version>1.0</version>
144         </dependency>
145         <dependency>
146             <groupId>org.aspectj</groupId>
147             <artifactId>aspectjweaver</artifactId>
148             <version>1.8.6</version>
149         </dependency>
150         <!-- spring framework end -->
151 
152         <dependency>
153             <groupId>org.quartz-scheduler</groupId>
154             <artifactId>quartz</artifactId>
155             <version>1.8.6</version>
156         </dependency>
157     </dependencies>
158 
159 </project>
View Code

相关文章:

  • 2021-12-07
  • 2021-09-19
  • 2022-12-23
  • 2021-10-03
  • 2021-09-08
  • 2021-12-21
  • 2021-06-21
猜你喜欢
  • 2022-02-16
  • 2022-12-23
  • 2022-01-30
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案