首页 > 其他分享 >pom.xml 常用配置(三)

pom.xml 常用配置(三)

时间:2023-10-16 22:07:00浏览次数:37  
标签:xml 常用 spring mybatis thymeleaf pom RELEASE org javax

Spring Context

<!-- Spring Context -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
    <version>5.2.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

MyBatis

<!-- Mybatis框架 -->
<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis</artifactId>
    <version>3.5.0</version>
</dependency>
<!-- MyBatis整合Spring -->
<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-spring</artifactId>
    <version>2.0.1</version>
</dependency>
<!-- Spring JDBC依赖,必须与其它Spring依赖使用完全相同的版本 -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>5.2.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.25</version>
</dependency>

SpringMVC

<!-- Spring MVC -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>5.2.2.RELEASE</version>
</dependency>
<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>
<!-- Thymeleaf -->
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
<!-- Thymeleaf整合Spring -->
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.25</version>
</dependency>

SpringThymeleaf

@Bean
public ThymeleafViewResolver viewResolver(){
    System.out.println("init ThymeleafViewResolver");

    //设置模板保存位置为 /resources/templates/*.html
    ClassLoaderTemplateResolver templateResolver = 
            new ClassLoaderTemplateResolver();
    //模版存储文件夹
    templateResolver.setPrefix("/templates/");
    //模版后缀
    templateResolver.setSuffix(".html");
    templateResolver.setCharacterEncoding("UTF-8");
    templateResolver.setTemplateMode(TemplateMode.HTML);
    templateResolver.setCacheable(true);
    //创建模板引擎
    SpringTemplateEngine templateEngine = 
            new SpringTemplateEngine();
    templateEngine.setTemplateResolver(templateResolver);
    templateEngine.setEnableSpringELCompiler(true);
    //创建模版解析器
    ThymeleafViewResolver viewResolver =
            new ThymeleafViewResolver();
    viewResolver.setCharacterEncoding("UTF-8");
    viewResolver.setTemplateEngine(templateEngine); 
    return viewResolver;
}

SSM整合

<!-- SpringMVC -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>5.2.2.RELEASE</version>
</dependency>
<!-- Spring JDBC依赖,必须与其它Spring依赖使用完全相同的版本 -->
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
    <version>5.2.2.RELEASE</version>
</dependency>
<!-- Mybatis框架 -->
<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis</artifactId>
    <version>3.5.0</version>
</dependency>
<!-- MyBatis整合Spring -->
<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-spring</artifactId>
    <version>2.0.1</version>
</dependency>
<!-- Thymeleaf -->
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
<!-- Thymeleaf整合Spring -->
<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf-spring5</artifactId>
    <version>3.0.11.RELEASE</version>
</dependency>
<!-- 连接MySQL数据库的依赖 -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.15</version>
</dependency>
<!-- 数据库连接池 -->
<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid</artifactId>
    <version>1.1.21</version>
</dependency>
<!-- 单元测试 -->
<dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.13</version>
    <scope>test</scope>
</dependency>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
    <version>1.7.25</version>
</dependency>

Jackson JSON API

<dependency>
  <groupId>com.fasterxml.jackson.core</groupId>
  <artifactId>jackson-databind</artifactId>
  <version>2.10.1</version>
</dependency>

Netty

<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.43.Final</version>
</dependency>

Apache Commons Codec

<dependency>
    <groupId>commons-codec</groupId>
    <artifactId>commons-codec</artifactId>
    <version>1.14</version>
</dependency>

Apache Commons Lang

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-lang3</artifactId>
    <version>3.10</version>
</dependency>

Apache Commons DBCP

<dependency>
    <groupId>org.apache.commons</groupId>
    <artifactId>commons-dbcp2</artifactId>
    <version>2.7.0</version>
</dependency>

Lombok

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.12</version>
    <scope>provided</scope>
</dependency>

备注:有关maven项目的基本配置已经更新完了,针对目前比较流行的微服务技术,后期我也会持续为大家更新有关springboot以及springcloud的maven配置,另外我也会给大家分享一些实用技术案例等,方便大家学习交流。

标签:xml,常用,spring,mybatis,thymeleaf,pom,RELEASE,org,javax
From: https://blog.51cto.com/u_16302118/7893760

相关文章

  • boot驱动模型中的常用API--Apple的学习笔记
    一,前言之前解决ping问题的过程中,需要看uboot的代码,感觉看起来很轻松,我一直觉得代码写的小学生都能看懂的,这才是高手写的代码。面向对象设计的好,封装做的也好。虽然和qemu的Qobject设计雷同,但是我又手痒想画图了。二,学习1,uclass_find(id)根据uclassid来找uclass。在gd->uclass_roo......
  • 随笔-调试-常用命令零散记录 2 网络工具
    【1】测量两点之间的带宽iperf测试是否千兆:服务端:iperf-s-u-p22345-i1客户端:iperf-c10.10.2.58-p22345-i1-t60-b1000M-u【2】net_stat.sh#!/bin/bashdeviation=0if_name=$1rx_bit=tx_bit=[[-z"$if_name"]]&&{echo"usage:$0[if_......
  • java.io.IOException: Could not find resource mapper/ProductCategoryMapper.xml 解
    java.io.IOException:Couldnotfindresourcemapper/ProductCategoryMapper.xml解决方案 一、问题背景通过MyBatisPlus测试达梦数据库过程中,运行测试类的时候,项目报错:“java.io.IOException:Couldnotfindresourcemapper/ProductCategoryMapper.xml”工程的目录......
  • pyspark 常用action 算子
    frompysparkimportSparkConf,SparkContextconf=SparkConf().setAppName("test_SamShare").setMaster("local[4]")sc=SparkContext(conf=conf)#1.collect指的是把数据汇集到driver端,便于后续操作rdd=sc.parallelize(range(0,5))rdd_collect=rdd.......
  • MySQL常用命令
    登录MySQL控制台:mysql-uusername-p:使用指定用户名登录MySQL,系统将提示输入密码mysql-hhost-uusername-p:使用指定主机、用户名登录MySQL,系统将提示输入密码quit或\q:退出控制台常见的SQL命令:CREATEDATABASEdbname;:创建名为dbname的数据库DROPDATABASEdbname;......
  • pyspark 常用Transform算子
    frompysparkimportSparkConf,SparkContextconf=SparkConf().setAppName("test_SamShare").setMaster("local[4]")sc=SparkContext(conf=conf)#1.map对每一个元素进行一个映射rdd=sc.parallelize(range(1,11),4)rdd_map=rdd.map(lambdax:x*2......
  • Linux常用命令
    一、入门步骤1、下载安装虚拟机VMware2、在虚拟机VMware上安装系统可以安装任何系统(Windows、Linux、mac等)LinuxCentOS做练习3、[root@ryan~]#认识提示符o [用户@计算机名当前目录]#o ~表示在访问root目录/表示根目录o #表示超级用户o $普通用户......
  • mysql常用查询
    1、Mysql查询某个表的字段名selectCOLUMN_NAMEfrominformation_schema.COLUMNSwheretable_name='business_info'; 2、生成数据字典selectTABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,COLUMN_TYPE,COLUMN_COMMENTfrominformation_schema.columnswhereTABLE_SCHEMA......
  • HDPE-高密度双壁波纹管材常用的应用领域有哪些?
    HDPE-高密度双壁波纹管材是一种由高密度聚乙烯制成的管材,具有特殊的波纹结构。HDPE-高密度双壁波纹管材常用的应用领域有:市政工程:可用于排水、排污管。建筑工程:用于建筑物雨水管、地下排水管、排污管、通风管。电气工程:可用于各种动力电缆的保护管公路、铁路通讯:用于通讯电缆、光缆......
  • logback-thtf.xml 日志输出控制
    <?xmlversion="1.0"encoding="UTF-8"?><configurationscan="true"scanPeriod="60seconds"debug="false"><!--日志存放路径--><propertyname="log.path"value="logs/go......