springboot项目使用的依赖和配置

依赖和配置

  • 提供的依赖(需要则截取)。
  • 父项目中
  • 子项目中
  • 配置文件

提供的依赖(需要则截取)。

父项目中

<properties>
        <mybaits-plus.version>3.2.0</mybaits-plus.version>
        <dubbo.version>2.7.3</dubbo.version>
        <boot-web-shiro.version>1.4.2</boot-web-shiro.version>
        <shiro-redis.version>3.2.3</shiro-redis.version>
        <swagger2.version>2.9.2</swagger2.version>
        <swagger-ui.version>1.9.6</swagger-ui.version>
        <hutool.version>5.0.7</hutool.version>
        <fastjson.version>1.2.62</fastjson.version>
        <fst.version>2.57</fst.version>
        <orika.version>1.5.4</orika.version>
        <lombok.version>1.18.8</lombok.version>
        <druid.version>1.1.10</druid.version>
    </properties>

    <!--依赖管理,只是声明依赖而已,并没有真正的使用依赖-->
    <dependencyManagement>
        <dependencies>
            <!--mybatis-plus-boot-starter 数据库curd操作-->
            <dependency>
                <groupId>com.baomidou</groupId>
                <artifactId>mybatis-plus-boot-starter</artifactId>
                <version>${mybaits-plus.version}</version>
            </dependency>
            <!--dubbo 和spring boot 轻量级rpc框架-->
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-spring-boot-starter</artifactId>
                <version>${dubbo.version}</version>
            </dependency>
            <!-- 使用zk 做注册中心,Dubbo 需要的依赖 -->
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-dependencies-zookeeper</artifactId>
                <version>${dubbo.version}</version>
                <type>pom</type>
                <!--在zk 里面排除了日志-->
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>slf4j-log4j12</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <!--shiro 和spring boot web 集成的方案-->
            <dependency>
                <groupId>org.apache.shiro</groupId>
                <artifactId>shiro-spring-boot-web-starter</artifactId>
                <version>${boot-web-shiro.version}</version>
            </dependency>
            <!-- redis 和shiro 整合 -->
            <dependency>
                <groupId>org.crazycake</groupId>
                <artifactId>shiro-redis</artifactId>
                <version>${shiro-redis.version}</version>
            </dependency>
            <!-- swagger2 接口文档 -->
            <dependency>
                <groupId>io.springfox</groupId>
                <artifactId>springfox-swagger2</artifactId>
                <version>${swagger2.version}</version>
            </dependency>
            <!-- swagger2的页面 -->
            <dependency>
                <groupId>com.github.xiaoymin</groupId>
                <artifactId>swagger-bootstrap-ui</artifactId>
                <version>${swagger-ui.version}</version>
            </dependency>
            <!-- hutool工具类 -->
            <dependency>
                <groupId>cn.hutool</groupId>
                <artifactId>hutool-all</artifactId>
                <version>${hutool.version}</version>
            </dependency>
            <!-- fastjson 高性能的json库 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>fastjson</artifactId>
                <version>${fastjson.version}</version>
            </dependency>
            <!-- FST 序列化工具 -->
            <dependency>
                <groupId>de.ruedigermoeller</groupId>
                <artifactId>fst</artifactId>
                <version>${fst.version}</version>
            </dependency>
            <!--对象映射工具-->
            <dependency>
                <groupId>ma.glasnost.orika</groupId>
                <artifactId>orika-core</artifactId>
                <version>${orika.version}</version>
            </dependency>
            <!--lombok 代码生成工具-->
            <dependency>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
                <version>${lombok.version}</version>
            </dependency>
            <!-- druid数据库连接池 -->
            <dependency>
                <groupId>com.alibaba</groupId>
                <artifactId>druid-spring-boot-starter</artifactId>
                <version>${druid.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

子项目中

<!--mysql 的驱动,版本来自spring boot 里面-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>
        <!--spring的切面编程-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-aop</artifactId>
        </dependency>
        <!--fastdfs分布式文件存储器依赖-->
        <dependency>
            <groupId>com.github.tobato</groupId>
            <artifactId>fastdfs-client</artifactId>
            <version>1.27.2</version>
        </dependency>
        <!--spring-boot 测试包-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
        </dependency>
        <!--用处:存储验证码,用户权限等-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>

消息系统

<!--activemq消息队列的依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-activemq</artifactId>
        </dependency>
        <!--池的依赖-->
        <dependency>
            <groupId>org.messaginghub</groupId>
            <artifactId>pooled-jms</artifactId>
        </dependency>
        <!--配置文件提示依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>
        <!--阿里云发送消息依赖-->
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <version>4.0.3</version>
        </dependency>
        <!--这是spring-boot-web-starter中的依赖。-->
        <!--restTemplate的依赖-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
        </dependency>
        <!-- hutool工具类 -->
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
        </dependency>

搜索引擎的依赖

<!--solr的依赖-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-solr</artifactId>
        </dependency>

支付系统

<!--下面三个依赖:支付宝相关依赖-->
        <dependency>
            <groupId>com.alipay.sdk</groupId>
            <artifactId>alipay-sdk-java</artifactId>
            <version>3.3.0</version>
        </dependency>
        <dependency>
            <groupId>com.alipay</groupId>
            <artifactId>alipay-trade-sdk</artifactId>
            <version>20161215</version>
        </dependency>
        <dependency>
            <groupId>commons-configuration</groupId>
            <artifactId>commons-configuration</artifactId>
            <version>1.10</version>
        </dependency>

配置文件

# 该app端口的配置
server:
  port: 8085
# 数据源配置
spring:
  datasource:
    url: jdbc:mysql://47.45.22.256:3306/ego-shop
    username: root
    password: 123456
    driver-class-name: com.mysql.cj.jdbc.Driver
  # redis的配置
  redis:
    port: 6379
    host: 47.45.22.256
# mybatis-plus的配置
mybatis-plus:
  mapper-locations: classpath:/mapper/*.xml
  type-aliases-package: com.zxm.entity
  configuration: # 日志的打印
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# dubbo的配置
dubbo:
  application:
    id: manager-web
    name: manager-web
  registry:
    protocol: zookeeper
    address: 47.45.22.256:2181
#FastDFS的配置
fdfs:
  so-timeout: 1501
  connect-timeout: 601
  tracker-list: 47.45.22.256:22122
#swagger 的配置
swagger2:
  base-package: com.zxm.controller
  name: 赵晓梦
  url: https://github.com/NymphWeb
  email: [email protected]
  version: 1.0
  title: 后台管理系统的接口
  description: 实现后台管理系统的所有的接口
  license: GPL
  license-url: https://gpl.com
  terms-of-service-url: www.xiaomeng.work
# fastdfs的自定义地址配置
resources:
  url: http://47.45.22.256:8080

支付的配置文件

dubbo:
  application: # 应用的名称
    id: ego-pay
    name: ego-pay
  registry: # 注册中心
    protocol: zookeeper
    address: 47.45.22.256:2181
  protocol: # 提供者监听的接口
    port: 4444
    name: dubbo
# 网页支付的基本参数配置
alipay:
  app-id: 
  merchant-private-key: 
  alipay-public-key: 
  # 内网映射  该隧道的id:144122215990  (一个月有效)
  notify-url: http://liangtiandong.vipgz2.idcfengye.com/pay/%s
  return-url: xxx

搜索的配置文件

#solr的配置
spring:
  data:
    solr:
      host: http://47.45.22.256:8983/solr/ego
  # activemq的配置
  activemq:
    broker-url: tcp://47.45.22.256:61616   # activemq的服务地址
    pool:
      enabled: true  # 启动pool
      max-sessions-per-connection: 20  # 每个连接支持的session数量
      max-connections: 5  # 最多有多少个连接
#dubbo的配置
dubbo:
  application: # 应用的名称
    id: search-service
    name: search-service
  registry: # 注册中心
    protocol: zookeeper
    address: 47.45.22.256:2181
  protocol:  # 提供者监听的端口
    name: dubbo
    port: 6666
# solr每页导入多少数量
import:
  size: 20

消息的配置文件

# activemq的配置
spring:
  activemq:
    broker-url: tcp://47.45.22.256:61616   # activemq的服务地址
    pool:
      enabled: true  # 启动pool
      max-sessions-per-connection: 20  # 每个连接支持的session数量
      max-connections: 5  # 最多有多少个连接
    packages:
      trust-all: true
sms:
  region-id: cn-hangzhou
  access-key-id: LTAI4FcUhhZyv4PJPqrNYxm8
  access-secret: rXl1gduvwg9KQGyUXlhVv7qaIjbNou
  sys-domain: dysmsapi.aliyuncs.com
  sys-version: 2017-05-25
wechat:
  appid: wxf2649ff3cc857252
  secret: c8425d246f2af79133978b783f027ec1
  token-url: https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s
  message-url: https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=%s

你可能感兴趣的:(前后端分离项目要点)