springMVC+Mybatis的maven-web项目的pom.xml文件内容

简介: pom.xml文件内容 1 2 4 4.0.0 5 6 7 com.yeepay.test 8 TestSM 9 war 10 0.

pom.xml文件内容

  1 <!-- 第一行是XML头,指定了该xml文档的版本和编码方式 -->
  2 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  4   <modelVersion>4.0.0</modelVersion><!-- 指定了当前POM模型的版本,对于Maven2及Maven 3来说,它只能是4.0.0。 -->
  5   
  6   <!-- groupId,artifactId和version三行。这三个元素定义了一个项目基本的坐标 -->
  7   <groupId>com.yeepay.test</groupId><!--定义了项目属于哪个组 -->
  8   <artifactId>TestSM</artifactId><!--定义了当前Maven项目在组中唯一的ID -->
  9   <packaging>war</packaging><!--指定打包类型,可以是war,jar,pom,ear等形式 -->
 10   <version>0.0.1-SNAPSHOT</version><!--指定了项目当前的版本 SNAPSHOT意为快照,说明该项目还处于开发中,是不稳定的版本。 -->
 11   
 12   <name>TestSM Maven Webapp</name><!--项目的名称, Maven产生的文档用 -->
 13   <url>http://maven.apache.org</url> <!--项目主页的URL, Maven产生的文档用-->
 14   
 15   
 16   <!-- 
 17      合成多个模块:一个项目有多个模块,也叫做多重模块,或者合成项目
 18   <modules>
 19         <module>nonbankcard-common</module>
 20         <module>nonbankcard-facade</module>
 21         <module>nonbankcard-core</module>
 22         <module>nonbankcard-hessian</module>
 23     </modules>
 24   --> 
 25   <!-- 
 26       父项目的坐标。如果项目中没有规定某个元素的值.父项目的packaging节点值是pom
 27   <parent>
 28       <groupId></groupId>
 29       <artifactId></artifactId>
 30       <version></version>
 31       父项目的pom.xml文件的相对路径。相对路径允许你选择一个不同的路径。
 32       默认值是../pom.xml。Maven首先在构建当前项目的地方寻找父项目的pom,
 33       其次在文件系统的这个位置(relativePath位置),
 34       然后在本地仓库
 35       最后在远程仓库寻找父项目的pom。
 36       <relativePath></relativePath>
 37   </parent>
 38    -->
 39    
 40   <!-- 该元素下可以包含多个dependency元素以声明项目的依赖,前面我们提到groupId、artifactId和version是任何一个Maven项目最基本的坐标 -->
 41   <dependencies>
 42        <dependency>
 43           <groupId>junit</groupId>
 44           <artifactId>junit</artifactId>
 45           <version>3.8.1</version>
 46           <scope>test</scope>
 47        </dependency>
 48        <dependency>
 49           <groupId>org.springframework</groupId>
 50           <artifactId>spring-web</artifactId>
 51           <version>3.2.0.RELEASE</version>
 52        </dependency>
 53        <dependency>
 54           <groupId>org.springframework</groupId>
 55           <artifactId>spring-webmvc</artifactId>
 56           <version>3.2.0.RELEASE</version>
 57        </dependency>
 58        <dependency>
 59           <groupId>org.springframework</groupId>
 60           <artifactId>spring-orm</artifactId>
 61           <version>3.2.0.RELEASE</version>
 62        </dependency>
 63        <dependency>
 64             <groupId>commons-fileupload</groupId>
 65             <artifactId>commons-fileupload</artifactId>
 66             <version>1.3.1</version>
 67        </dependency>
 68        <dependency>
 69             <groupId>javax.servlet</groupId>
 70             <artifactId>jstl</artifactId>
 71             <version>1.2</version>
 72        </dependency>
 73        <dependency>
 74             <groupId>taglibs</groupId>
 75             <artifactId>standard</artifactId>
 76             <version>1.1.2</version>
 77        </dependency>
 78        <dependency>
 79             <groupId>org.mybatis</groupId>
 80             <artifactId>mybatis</artifactId>
 81             <version>3.2.7</version>
 82        </dependency>
 83        <dependency>
 84           <groupId>org.mybatis</groupId>
 85           <artifactId>mybatis-spring</artifactId>
 86           <version>1.2.2</version>
 87        </dependency>
 88        <dependency>
 89               <groupId>mysql</groupId>
 90               <artifactId>mysql</artifactId>
 91               <version>1</version>
 92           </dependency>
 93           <dependency>
 94             <groupId>javax.servlet</groupId>
 95             <artifactId>servlet-api</artifactId>
 96             <version>2.4</version>
 97             <scope>provided</scope>
 98            </dependency>
 99            <dependency>
100             <groupId>com.alibaba</groupId>
101             <artifactId>fastjson</artifactId>
102             <version>1.1.25</version>
103         </dependency>
104         <dependency>
105             <groupId>cglib</groupId>
106             <artifactId>cglib</artifactId>
107             <version>3.0</version>
108         </dependency>
109         
110         <dependency>
111             <groupId>org.aspectj</groupId>
112             <artifactId>aspectjrt</artifactId>
113             <version>1.6.11</version>
114         </dependency>
115  
116         <dependency>
117             <groupId>org.aspectj</groupId>
118             <artifactId>aspectjweaver</artifactId>
119             <version>1.6.11</version>
120         </dependency>
121         <dependency>    
122             <groupId>org.slf4j</groupId>    
123             <artifactId>slf4j-api</artifactId>    
124             <version>1.6.6</version>    
125         </dependency>    
126         <dependency>    
127             <groupId>org.slf4j</groupId>    
128             <artifactId>jcl-over-slf4j</artifactId>    
129             <version>1.6.6</version>    
130             <scope>runtime</scope>    
131           </dependency>    
132         <dependency>    
133             <groupId>org.slf4j</groupId>    
134             <artifactId>slf4j-log4j12</artifactId>    
135             <version>1.6.6</version>    
136             <scope>runtime</scope>    
137         </dependency> 
138         
139   </dependencies>
140   
141   <!-- 功能集标签,在此标签下面可以定义一系列的插件以实现功能 
142         主要用于编译设置,一般包含两种标签:resource和plugins,前者用于排除或包含某些资源文件,后者用来设置插件。
143         例如:在用Junit4写测试程序,用到了@test等注解,
144         但是由于Maven的核心插件之一compiler插件默认只支持编译java1.3,因此需要配置该插件使其支持java5,需要修改pom文件如下:
145   -->
146   <build>
147     <finalName>TestSM</finalName><!-- 当前项目的 <artifactId>标示-->
148     <!-- Maven的编译插件默认是JDK 1.4的编译级别,为了让Maven的编译插件使用JDK5.0的编译级别,需要对编译插件作如下配置 -->
149     <plugins>
150         <plugin>
151             <groupId>org.apache.maven.plugins</groupId>
152             <artifactId>maven-compiler-plugin</artifactId>
153             <version>2.0</version>
154             <configuration>
155                 <source>1.5</source>
156                 <target>1.5</target>
157             </configuration>
158         </plugin>
159     </plugins>
160   </build>
161 </project>
View Code

 

相关文章
|
1月前
|
安全 测试技术 程序员
web渗透-文件包含漏洞
文件包含漏洞源于程序动态包含文件时未严格校验用户输入,导致可加载恶意文件。分为本地和远程包含,常见于PHP,利用伪协议、日志或session文件可实现代码执行,需通过合理过滤和配置防范。
452 79
web渗透-文件包含漏洞
|
4月前
|
Web App开发 监控 安全
OSS客户端签名直传实践:Web端安全上传TB级文件方案(含STS临时授权)
本文深入解析了客户端直传技术,涵盖架构设计、安全机制、性能优化等方面。通过STS临时凭证与分片上传实现高效安全的文件传输,显著降低服务端负载与上传耗时,提升系统稳定性与用户体验。
474 2
|
7月前
|
前端开发 Java 测试技术
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@RequestParam
本文介绍了 `@RequestParam` 注解的使用方法及其与 `@PathVariable` 的区别。`@RequestParam` 用于从请求中获取参数值(如 GET 请求的 URL 参数或 POST 请求的表单数据),而 `@PathVariable` 用于从 URL 模板中提取参数。文章通过示例代码详细说明了 `@RequestParam` 的常用属性,如 `required` 和 `defaultValue`,并展示了如何用实体类封装大量表单参数以简化处理流程。最后,结合 Postman 测试工具验证了接口的功能。
388 0
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@RequestParam
|
7月前
|
XML Java 数据库连接
微服务——SpringBoot使用归纳——Spring Boot集成MyBatis——基于 xml 的整合
本教程介绍了基于XML的MyBatis整合方式。首先在`application.yml`中配置XML路径,如`classpath:mapper/*.xml`,然后创建`UserMapper.xml`文件定义SQL映射,包括`resultMap`和查询语句。通过设置`namespace`关联Mapper接口,实现如`getUserByName`的方法。Controller层调用Service完成测试,访问`/getUserByName/{name}`即可返回用户信息。为简化Mapper扫描,推荐在Spring Boot启动类用`@MapperScan`注解指定包路径避免逐个添加`@Mapper`
351 0
|
7月前
|
JSON 前端开发 Java
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@RequestBody
`@RequestBody` 是 Spring 框架中的注解,用于将 HTTP 请求体中的 JSON 数据自动映射为 Java 对象。例如,前端通过 POST 请求发送包含 `username` 和 `password` 的 JSON 数据,后端可通过带有 `@RequestBody` 注解的方法参数接收并处理。此注解适用于传递复杂对象的场景,简化了数据解析过程。与表单提交不同,它主要用于接收 JSON 格式的实体数据。
591 0
|
7月前
|
前端开发 Java 微服务
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@PathVariable
`@PathVariable` 是 Spring Boot 中用于从 URL 中提取参数的注解,支持 RESTful 风格接口开发。例如,通过 `@GetMapping(&quot;/user/{id}&quot;)` 可以将 URL 中的 `{id}` 参数自动映射到方法参数中。若参数名不一致,可通过 `@PathVariable(&quot;自定义名&quot;)` 指定绑定关系。此外,还支持多参数占位符,如 `/user/{id}/{name}`,分别映射到方法中的多个参数。运行项目后,访问指定 URL 即可验证参数是否正确接收。
382 0
|
7月前
|
JSON 前端开发 Java
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@RequestMapping
@RequestMapping 是 Spring MVC 中用于请求地址映射的注解,可作用于类或方法上。类级别定义控制器父路径,方法级别进一步指定处理逻辑。常用属性包括 value(请求地址)、method(请求类型,如 GET/POST 等,默认 GET)和 produces(返回内容类型)。例如:`@RequestMapping(value = &quot;/test&quot;, produces = &quot;application/json; charset=UTF-8&quot;)`。此外,针对不同请求方式还有简化注解,如 @GetMapping、@PostMapping 等。
350 0
|
7月前
|
JSON 前端开发 Java
微服务——SpringBoot使用归纳——Spring Boot中的MVC支持——@RestController
本文主要介绍 Spring Boot 中 MVC 开发常用的几个注解及其使用方式,包括 `@RestController`、`@RequestMapping`、`@PathVariable`、`@RequestParam` 和 `@RequestBody`。其中重点讲解了 `@RestController` 注解的构成与特点:它是 `@Controller` 和 `@ResponseBody` 的结合体,适用于返回 JSON 数据的场景。文章还指出,在需要模板渲染(如 Thymeleaf)而非前后端分离的情况下,应使用 `@Controller` 而非 `@RestController`
242 0
|
3月前
|
前端开发 Java API
Spring Cloud Gateway Server Web MVC报错“Unsupported transfer encoding: chunked”解决
本文解析了Spring Cloud Gateway中出现“Unsupported transfer encoding: chunked”错误的原因,指出该问题源于Feign依赖的HTTP客户端与服务端的`chunked`传输编码不兼容,并提供了具体的解决方案。通过规范Feign客户端接口的返回类型,可有效避免该异常,提升系统兼容性与稳定性。
243 0
|
3月前
|
SQL Java 数据库连接
Spring、SpringMVC 与 MyBatis 核心知识点解析
我梳理的这些内容,涵盖了 Spring、SpringMVC 和 MyBatis 的核心知识点。 在 Spring 中,我了解到 IOC 是控制反转,把对象控制权交容器;DI 是依赖注入,有三种实现方式。Bean 有五种作用域,单例 bean 的线程安全问题及自动装配方式也清晰了。事务基于数据库和 AOP,有失效场景和七种传播行为。AOP 是面向切面编程,动态代理有 JDK 和 CGLIB 两种。 SpringMVC 的 11 步执行流程我烂熟于心,还有那些常用注解的用法。 MyBatis 里,#{} 和 ${} 的区别很关键,获取主键、处理字段与属性名不匹配的方法也掌握了。多表查询、动态
128 0

推荐镜像

更多