pom.xml中的常用依赖包大全

pom.xml是maven项目中的一个很重要的文件,很多依赖都在这个文件中配置。

pom.xml依赖的配置主要分为:

                                两大依赖:1.模块依赖;2.框架依赖

                                三个部分:1.对于项目本身模块的依赖;2:对于自己公司的封装包的依赖;3:对于第三方包的依赖。

(一)、Dao层的典型依赖-----和数据相关的依赖

1. spring-jdbc

<dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
</dependency>

2. spring-data-commons(分页...)

<dependency>
       <groupId>org.springframework.data</groupId>
       <artifactId>spring-data-commons</artifactId>
</dependency>

3.mybatis( 公司包)

<dependency>
       <groupId>com.xxxx.framework</groupId>
       <artifactId>xxxx-mybatis</artifactId>
</dependency>

4.redis(公司包)

<dependency>
       <groupId>com.vivo.framework</groupId>
       <artifactId>vivo-redis</artifactId>
</dependency>

(二)、Service层的典型依赖:

Apache:

1. common-lang3----各种工具类(StringUtils...)

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

2.common-collections(集合工具类)

<dependency>
       <groupId>commons-collections</groupId>
       <artifactId>commons-collections</artifactId>
</dependency>

3. common-io(IO工具类)

<dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>
</dependency>

4. Json

      4.1 json 三大组件:

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

 4.2 其他的json三方包---alibaba

<dependency>
       <groupId>com.alibaba</groupId>
        <artifactId>fastjson</artifactId>
</dependency>

4.3 JSONArray.fromObject依赖

<dependency>
     <groupId>commons-beanutils</groupId>
     <artifactId>commons-beanutils</artifactId>
     <version>1.9.3</version>
</dependency>
<dependency>
     <groupId>commons-collections</groupId>
     <artifactId>commons-collections</artifactId>
</dependency>
<dependency>
     <groupId>commons-lang</groupId>
     <artifactId>commons-lang</artifactId>
     <version>2.6</version>
</dependency>
<dependency>
     <groupId>commons-logging</groupId>
     <artifactId>commons-logging</artifactId>
     <version>1.1.1</version>
</dependency>
<dependency>
     <groupId>net.sf.ezmorph</groupId>
     <artifactId>ezmorph</artifactId>
     <version>1.0.6</version>
</dependency>
<dependency>
     <groupId>net.sf.json-lib</groupId>
     <artifactId>json-lib</artifactId>
     <version>2.2.3</version>
     <classifier>jdk15</classifier><!-- jdk版本 -->
</dependency>

5. 日志

<!--log-->
<dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
 </dependency>
 <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
 </dependency>
  
<!-- common-logging -->
<dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jcl-over-slf4j</artifactId>
 </dependency>
 
<!-- java.util.logging  -->
<dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>jul-to-slf4j</artifactId>
</dependency>

6.Spring(7大组件)

<!--spring start -->
<dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-core</artifactId>
</dependency>
<dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-beans</artifactId>
</dependency>
<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
</dependency>
<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-aop</artifactId>
</dependency>
<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-aspects</artifactId>
</dependency>
<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-expression</artifactId>
</dependency>
<!--spring end -->

7. xxxx-commons(公司框架--读写分离、多库多表....)

<dependency>
       <groupId>com.xxxx.framework</groupId>
       <artifactId>xxxx-commons</artifactId>
</dependency>

8.commons-validator (通用验证系统)

<dependency>
       <groupId>commons-validator</groupId>
       <artifactId>commons-validator</artifactId>
</dependency>

9.dubbo(阿里巴巴的分布式框架)

<dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>dubbo</artifactId>
      <exclusions>
           <exclusion>
                <artifactId>curator-client</artifactId>
                <groupId>org.apache.curator</groupId>
            </exclusion>
       </exclusions>
</dependency>

10.curator-framework(Zookeeper客户端)

 <dependency>
      <groupId>org.apache.curator</groupId>
      <artifactId>curator-framework</artifactId>
 </dependency>

11.Dao层的依赖(spring-jdbc/spring-data-commons/mybatis/redis)

<dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-jdbc</artifactId>
</dependency>

<dependency>
      <groupId>org.springframework.data</groupId>
      <artifactId>spring-data-commons</artifactId>
</dependency>

<dependency>
       <groupId>com.vivo.framework</groupId>
       <artifactId>vivo-mybatis</artifactId>
</dependency>

<dependency>
       <groupId>com.vivo.framework</groupId>
       <artifactId>vivo-redis</artifactId>
</dependency>

(三)、Web层的典型依赖:

1. 模块依赖对Service层的依赖

2.框架依赖

2.1 spring-web

<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-web</artifactId>
</dependency>

2.2 spring-webmvc

<dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-webmvc</artifactId>
</dependency>

2.3  servlet-api(前端控制器DispacherServlet就是一个servlet)

<dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
        <scope>provided</scope>//如果不配置scope,会把jar包发布,会跟容器里的jar包冲突
</dependency>

JSTL使用需要的两个包

2.4 jstl(java script tag language)

<dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
</dependency>

2.5 taglibs(标签库)

<dependency>
       <groupId>taglibs</groupId>
       <artifactId>standard</artifactId>
</dependency>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值