jpaas-portal 依赖项目与第三方库

jpaas-portal是平台的门户项目,它依赖了以下几块:

平台子模块

  1. jpaas-auth 统一认证
  2. jpaas-gateway 网关
  3. jpaas-config 配置中心
  4. jpaas-share 公共实体模块

依赖平台的公共模块

  1. <dependency>
  2. <groupId>com.redxun</groupId>
  3. <artifactId>jpaas-config</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>com.redxun</groupId>
  7. <artifactId>jpaas-share</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>com.redxun</groupId>
  11. <artifactId>jpaas-common-spring-boot-starter</artifactId>
  12. </dependency>
  13. <dependency>
  14. <groupId>com.redxun</groupId>
  15. <artifactId>jpaas-cache-spring-boot-starter</artifactId>
  16. </dependency>
  17. <dependency>
  18. <groupId>com.redxun</groupId>
  19. <artifactId>jpaas-db-spring-boot-starter</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>com.redxun</groupId>
  23. <artifactId>jpaas-redis-spring-boot-starter</artifactId>
  24. </dependency>
  25. <dependency>
  26. <groupId>com.redxun</groupId>
  27. <artifactId>jpaas-ribbon-spring-boot-starter</artifactId>
  28. </dependency>
  29. <dependency>
  30. <groupId>com.redxun</groupId>
  31. <artifactId>jpaas-sentinel-spring-boot-starter</artifactId>
  32. </dependency>
  33. <!-- swagger -->
  34. <dependency>
  35. <groupId>com.redxun</groupId>
  36. <artifactId>jpaas-swagger2-spring-boot-starter</artifactId>
  37. </dependency>
  38. <dependency>
  39. <groupId>com.redxun</groupId>
  40. <artifactId>jpaas-auth-client-spring-boot-starter</artifactId>
  41. </dependency>
  42. <dependency>
  43. <groupId>com.redxun</groupId>
  44. <artifactId>jpaas-web-spring-boot-starter</artifactId>
  45. </dependency>
  46. <dependency>
  47. <groupId>com.redxun</groupId>
  48. <artifactId>jpaas-common-dto</artifactId>
  49. </dependency>

依赖 Spring boot的部分模块

  1. <dependency>
  2. <groupId>org.springframework.security.oauth</groupId>
  3. <artifactId>spring-security-oauth2</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>org.springframework.boot</groupId>
  7. <artifactId>spring-boot-starter-web</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>com.alibaba.cloud</groupId>
  11. <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
  12. </dependency>
  13. <dependency>
  14. <groupId>org.springframework</groupId>
  15. <artifactId>spring-context-support</artifactId>
  16. </dependency>
  17. <dependency>
  18. <groupId>org.springframework.boot</groupId>
  19. <artifactId>spring-boot-starter-actuator</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>org.springframework.social</groupId>
  23. <artifactId>spring-social-security</artifactId>
  24. </dependency>

其他功能包

  1. <dependency>
  2. <groupId>mysql</groupId>
  3. <artifactId>mysql-connector-java</artifactId>
  4. </dependency>
  5. <dependency>
  6. <groupId>io.micrometer</groupId>
  7. <artifactId>micrometer-registry-prometheus</artifactId>
  8. </dependency>
  9. <dependency>
  10. <groupId>com.alibaba.cloud</groupId>
  11. <artifactId>spring-cloud-alibaba-seata</artifactId>
  12. </dependency>
  13. <dependency>
  14. <groupId>io.seata</groupId>
  15. <artifactId>seata-spring-boot-starter</artifactId>
  16. </dependency>
  17. <dependency>
  18. <groupId>io.seata</groupId>
  19. <artifactId>seata-all</artifactId>
  20. </dependency>
  21. <dependency>
  22. <groupId>com.typesafe</groupId>
  23. <artifactId>config</artifactId>
  24. </dependency>
  25. <dependency>
  26. <groupId>commons-pool</groupId>
  27. <artifactId>commons-pool</artifactId>
  28. </dependency>
  29. <dependency>
  30. <groupId>com.taobao</groupId>
  31. <artifactId>usersync</artifactId>
  32. <version>1.0</version>
  33. </dependency>

代码运行

依赖数据库jpaas-user

先在数据库中创建jpaas-user,请参考4.平台源码运行的脚本执行。

nacos的数据库配置

依赖了nacos的,需要在nacos中配置流程模块的数据库连接:

进入nacos的配置,找到相应的环境的配置文件,如在开发环境下使用的是dev的配置文件:

代码如下:

  1. user.datasource.url=jdbc:mysql://localhost:3308/jpaas_user?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false&serverTimezone=GMT%2B8
  2. user.datasource.username=root
  3. user.datasource.password=root
  4. user.datasource.driver=com.mysql.cj.jdbc.Driver
  5. user.datasource.connection=

进入编辑页,项目的application.yml,检查以下信息 是否如下,一般来说不用修改:

  1. defaultDs:
  2. string:
  3. url: ${user.datasource.url}
  4. username: ${user.datasource.username}
  5. password: ${user.datasource.password}
  6. driver-class-name: ${user.datasource.driver}
  7. connection-init-sqls: ${user.datasource.connection}
  8. validationQuery: select 1
  9. filters: stat
  10. int:
  11. initialSize: 5
  12. minIdle: 5
  13. maxActive: 10
  14. maxPoolPreparedStatementPerConnectionSize: 20
  15. long:
  16. maxWait: 60000
  17. timeBetweenEvictionRunsMillis: 60000
  18. minEvictableIdleTimeMillis: 300000
  19. boolean:
  20. testWhileIdle: true
  21. testOnBorrow: false
  22. testOnReturn: false
  23. poolPreparedStatements: true

运行依赖

需要优先启动以下几个模块

  1. nacos
  2. seata
  3. jpaas-auth
  4. jpaas-gateway
  5. jpaas-user

然后再运行本模块即可,即执行JpaasUserApplication类即可,在Idea中的启动项,配置nacos.address地址

文档更新时间: 2020-09-28 15:20   作者:shengzhongwen