当前位置:   article > 正文

java依赖大全_javax依赖

javax依赖

一、Spring

1、依赖

①Spring核心依赖

  1. <dependency>
  2. <groupId>org.springframework</groupId>
  3. <artifactId>spring-context</artifactId>
  4. <version>5.2.13.RELEASE</version>
  5. </dependency>

SpringAop

spring-aspects依赖包

作用:spring整合AspectJ框架,提供aop注解(@Aspect、@Pointcut、@Before、@AfterReturning、@Around、@AfterThrowing、@After)

  1. <dependency>
  2. <groupId>org.springframework</groupId>
  3. <artifactId>spring-aspects</artifactId>
  4. <version>5.2.13.RELEASE</version>
  5. </dependency>

③Spring整合JDBC、Spring事务管理

Spring核心依赖包spring-context

  1. <dependency>
  2. <groupId>org.springframework</groupId>
  3. <artifactId>spring-context</artifactId>
  4. <version>5.2.13.RELEASE</version>
  5. </dependency>

mysql-connector-java

作用:引入驱动器Driver(com.mysql.cj.jdbc.Driver)

注意:使用8.0.23版本,不能使用8.0.22版本(有bug)

  1. <dependency>
  2. <groupId>mysql</groupId>
  3. <artifactId>mysql-connector-java</artifactId>
  4. <version>8.0.23</version>
  5. </dependency>

spring-jdbc

作用:使用JdbcTemplate操作数据库、事务注解、注解管理

  1. <dependency>
  2. <groupId>org.springframework</groupId>
  3. <artifactId>spring-jdbc</artifactId>
  4. <version>5.2.13.RELEASE</version>
  5. <scope>test</scope>
  6. </dependency>

二、SpringMVC

①SpringMVC核心依赖

  1. <!--spring-mvc依赖-->
  2. <dependency>
  3. <groupId>org.springframework</groupId>
  4. <artifactId>spring-webmvc</artifactId>
  5. <version>5.2.13.RELEASE</version>
  6. </dependency>
  7. <!--mvc底层是servlet,必须添加servlet依赖-->
  8. <dependency>
  9. <groupId>javax.servlet</groupId>
  10. <artifactId>javax.servlet-api</artifactId>
  11. <version>4.0.1</version>
  12. <!--provided(编译时有效,打包时不会打包在war包中)-->
  13. <scope>provided</scope>
  14. </dependency>

②@ResponseBody 注解

  1. <!--当返回类型是对象时,需要使用@ResponseBody 注解,将转换后的 JSON 数据放入到响应体中。-->
  2. <dependency>
  3. <groupId>com.fasterxml.jackson.core</groupId>
  4. <artifactId>jackson-core</artifactId>
  5. <version>2.9.0</version>
  6. </dependency>
  7. <dependency>
  8. <groupId>com.fasterxml.jackson.core</groupId>
  9. <artifactId>jackson-databind</artifactId>
  10. <version>2.9.0</version>
  11. </dependency>

③文件上传

  1. <!--文件上传-->
  2. <dependency>
  3. <groupId>commons-fileupload</groupId>
  4. <artifactId>commons-fileupload</artifactId>
  5. <version>1.3.1</version>
  6. </dependency>

三、Mybatis

①Mybatis核心依赖

  1. <dependency>
  2. <groupId>org.mybatis</groupId>
  3. <artifactId>mybatis</artifactId>
  4. <version>3.5.6</version>
  5. </dependency>

②log4j

  1. <dependency>
  2. <groupId>log4j</groupId>
  3. <artifactId>log4j</artifactId>
  4. <version>1.2.17</version>
  5. </dependency>

四、SpringBoot

①SpringBoot父工程

作用:提供@Configuration、@Bean注解

  1. <parent>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-parent</artifactId>
  4. <version>2.1.2.RELEASE</version>
  5. </parent>

②SpringBoot-Web启动器

作用:创建Web工程使用

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-web</artifactId>
  4. </dependency>

③SpringBoot-Jdbc启动器

作用:SpringBoot整合Jdbc

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-jdbc</artifactId>
  4. </dependency>

④SpringBoot-test启动器

作用:SpringBoot测试依赖,配合@RunWith(SpringRunner.class)和@SpringBootTest使用

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-test</artifactId>
  4. </dependency>

⑤SpringBoot-thymeleaf启动器

作用:SpringBoot整合thymeleaf

  1. <dependency>
  2. <groupId>org.springframework.boot</groupId>
  3. <artifactId>spring-boot-starter-thymeleaf</artifactId>
  4. </dependency>

⑥布局框架thymeleaf-layout-dialect

作用:有了这个布局框架,你可以专注于body体的内容,不在纠结与left header footer 公共js css

  1. <dependency>
  2. <groupId>nz.net.ultraq.thymeleaf</groupId>
  3. <artifactId>thymeleaf-layout-dialect</artifactId>
  4. </dependency>

⑦mybatis-spring-boot-starter

作用:SpringBoot整合Mybatis,提供@Mapper,@MapperScan注解

  1. <dependency>
  2. <groupId>org.mybatis.spring.boot</groupId>
  3. <artifactId>mybatis-spring-boot-starter</artifactId>
  4. <version>1.3.2</version>
  5. </dependency>

⑧mapper-spring-boot-starter

作用:SpringBoot整合tk-Mybatis,自动引入mybatis-spring-boot-starter依赖,提供@Table、@Id、@GeneratedValue、@Column、@Transient、@MapperScan注解

  1. <dependency>
  2. <groupId>tk.mybatis</groupId>
  3. <artifactId>mapper-spring-boot-starter</artifactId>
  4. <version>2.0.2</version>
  5. </dependency>

⑨mybatis-plus-boot-starter

作用:SpringBoot整合Mybatis Plus,自动引入mybatis-spring-boot-starter依赖,提供@TableName、@TableId、@TableField注解

  1. <dependency>
  2. <groupId>com.baomidou</groupId>
  3. <artifactId>mybatis-plus-boot-starter</artifactId>
  4. <version>3.3.2</version>
  5. </dependency>

⑩lombok

作用:简化实体类开发,免写get/set方法和toString方法,提供@Data、@Accessors注解

  1. <dependency>
  2. <groupId>org.projectlombok</groupId>
  3. <artifactId>lombok</artifactId>
  4. <version>1.18.22</version>
  5. <scope>provided</scope>
  6. </dependency>

文章参考:https://blog.csdn.net/adsfds/article/details/123232694

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/88857
推荐阅读
相关标签
  

闽ICP备14008679号