Maven 常用坐标依赖整理 (长期更新)

Maven 常用坐标依赖

  • 零、常见环境搭建
      • 0.1 SSH 搭建
      • 0.2 SSM 搭建
  • 一、Java SE 阶段
      • 1.1 单元测试坐标依赖
      • 1.2 动态代理坐标依赖
  • 二、Java EE 阶段
      • 2.1 JSTL 1.2 + standard
      • 2.2 servlet 中相关 API
      • 2.3 JSP 相关 API
  • 三、数据库基础配置
      • 3.1 MySQL 数据库
      • 3.2 数据库连接池
        • 3.2.1 阿里巴巴 Druiid 连接池
        • 3.2.2 c3p0 数据库连接池
  • 四、Spring + SpringMVC 常用依赖
      • 4.1 Spring 基础
      • 4.2 开启 Spring AOP
      • 4.3 SpringMVC 相关
      • 4.4 整合 JDBCTemplate
  • 五、ORM 相关
      • 5.1 MyBatis
      • 5.2 hibernate
  • 六、其它框架
      • 6.1 mvc 框架 struct2
  • 七、工具类
      • 7.1 fastjson 之 JSON 数据封装
      • 7.2 文件上传
      • 7.3 日志打印

整理整合了我学习 Maven 搭建项目时,中常用的坐标依赖,现在分享给大家参考使用

零、常见环境搭建

0.1 SSH 搭建

常见环境搭建 SSH:Struct2 + hibernate5 + Spring5

0.2 SSM 搭建

常见环境搭建 SSM: Spring + SpringMVC + MyBatis

一、Java SE 阶段

1.1 单元测试坐标依赖

        <dependency>
            <groupId>junitgroupId>
            <artifactId>junitartifactId>
            <version>4.10version>
        dependency>

1.2 动态代理坐标依赖

        <dependency>
            <groupId>cglibgroupId>
            <artifactId>cglibartifactId>
            <version>2.1_3version>
        dependency>

二、Java EE 阶段

2.1 JSTL 1.2 + standard

    <dependency>
            <groupId>javax.servlet.jsp.jstlgroupId>
            <artifactId>jstl-apiartifactId>
            <version>1.2version>
    dependency>
    
	<dependency>
	   <groupId>taglibsgroupId>
	   <artifactId>standardartifactId>
	   <version>1.1.2version>
	dependency>

2.2 servlet 中相关 API

    <dependency>
      <groupId>javax.servletgroupId>
      <artifactId>javax.servlet-apiartifactId>
      <version>4.0.0version>
      <scope>compilescope>
    dependency>

2.3 JSP 相关 API


    <dependency>
      <groupId>javax.servlet.jspgroupId>
      <artifactId>jsp-apiartifactId>
      <version>2.2version>
      <scope>providedscope>
    dependency>

三、数据库基础配置

3.1 MySQL 数据库

适用于 mysql 5.5

        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>5.1.10version>
            <scope>runtimescope>
        dependency>

适用于 mysql 8.0

        <dependency>
            <groupId>mysqlgroupId>
            <artifactId>mysql-connector-javaartifactId>
            <version>8.0.13version>
            <scope>runtimescope>
        dependency>

3.2 数据库连接池

3.2.1 阿里巴巴 Druiid 连接池

        <dependency>
            <groupId>com.alibabagroupId>
            <artifactId>druidartifactId>
            <version>1.1.22version>
        dependency>

3.2.2 c3p0 数据库连接池

        <dependency>
            <groupId>c3p0groupId>
            <artifactId>c3p0artifactId>
            <version>0.9.1.2version>
        dependency>
		
		
		 <dependency>
		      <groupId>com.mchangegroupId>
		      <artifactId>c3p0artifactId>
		      <version>0.9.5.2version>
		dependency>

四、Spring + SpringMVC 常用依赖

4.1 Spring 基础

	
       <dependency>
           <groupId>org.springframeworkgroupId>
           <artifactId>spring-contextartifactId>
           <version>5.2.3.RELEASEversion>
       dependency>
	
	   <dependency>
	     <groupId>org.springframeworkgroupId>
	     <artifactId>spring-testartifactId>
	     <version>${spring.version}version>
	   dependency>
	   
        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-txartifactId>
            <version>5.2.3.RELEASEversion>
        dependency>
        
	    <dependency>
	      <groupId>org.springframeworkgroupId>
	      <artifactId>spring-ormartifactId>
	      <version>5.1.0.RELEASEversion>
	    dependency>

4.2 开启 Spring AOP

	    <dependency>
	      <groupId>org.springframeworkgroupId>
	      <artifactId>spring-aopartifactId>
	      <version>5.2.3.RELEASEversion>
	    dependency>
		
        <dependency>
            <groupId>org.aspectjgroupId>
            <artifactId>aspectjweaverartifactId>
            <version>1.8.7version>
        dependency>

4.3 SpringMVC 相关

	    <dependency>
	      <groupId>org.springframeworkgroupId>
	      <artifactId>spring-webartifactId>
          <version>5.2.3.RELEASEversion>
	    dependency>
	
	    <dependency>
	      <groupId>org.springframeworkgroupId>
	      <artifactId>spring-webmvcartifactId>
          <version>5.2.3.RELEASEversion>
	    dependency>

4.4 整合 JDBCTemplate

        <dependency>
            <groupId>org.springframeworkgroupId>
            <artifactId>spring-jdbcartifactId>
            <version>5.2.3.RELEASEversion>
        dependency>

五、ORM 相关

5.1 MyBatis

	
    <dependency>
      <groupId>org.mybatisgroupId>
      <artifactId>mybatisartifactId>
      <version>3.4.5version>
    dependency>
    
	
    <dependency>
      <groupId>org.mybatisgroupId>
      <artifactId>mybatis-springartifactId>
      <version>1.3.3version>
    dependency>

5.2 hibernate

    
    <dependency>
      <groupId>org.hibernategroupId>
      <artifactId>hibernate-coreartifactId>
      <version>5.0.12.Finalversion>
    dependency>

六、其它框架

6.1 mvc 框架 struct2

    <dependency>
      <groupId>org.apache.strutsgroupId>
      <artifactId>struts2-coreartifactId>
      <version>2.5.10.1version>
    dependency>

	
    <dependency>
      <groupId>org.apache.strutsgroupId>
      <artifactId>struts2-json-pluginartifactId>
      <version>2.5.22version>
    dependency>

七、工具类

7.1 fastjson 之 JSON 数据封装

    <dependency>
      <groupId>com.alibabagroupId>
      <artifactId>fastjsonartifactId>
      <version>1.2.68version>
    dependency>

7.2 文件上传

    <dependency>
      <groupId>commons-fileuploadgroupId>
      <artifactId>commons-fileuploadartifactId>
      <version>1.4version>
    dependency>

    <dependency>
      <groupId>commons-iogroupId>
      <artifactId>commons-ioartifactId>
      <version>2.0version>
    dependency>

7.3 日志打印

log4j 日志打印

    <dependency>
      <groupId>org.apache.logging.log4jgroupId>
      <artifactId>log4j-coreartifactId>
      <version>2.9.1version>
    dependency>
    <dependency>
      <groupId>org.apache.logging.log4jgroupId>
      <artifactId>log4j-apiartifactId>
      <version>2.9.1version>
    dependency>

你可能感兴趣的:(java学习)