# matrix **Repository Path**: Initializr/matrix ## Basic Information - **Project Name**: matrix - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-12-18 - **Last Updated**: 2021-03-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 简介 matrix是一个快速构建springboot 项目的脚手架 ## 优点 - 父项目内置了三个maven profile (dev/test/prod),并设置打包名称生成规则方式,方便环境区分,默认激活dev,并提供根据profiledeploy不同版本号的jar包和依赖不同版本的jar包的功能 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0121/172550_8875793a_484241.png "屏幕截图.png") - 项目对外jar包 | 环境 | 版本号 | | | ---- | ------------- | ---- | | dev | -DEV-SNAPSHOT | | | test | -SNAPSHOT | | | prod | .RELEASE | | 父项目版本定义 ```xml 1.0.0${ver_type} ``` build节点添加 ```xml org.codehaus.mojo flatten-maven-plugin ${flatten-maven-plugin.version} true flatten process-resources flatten true oss remove remove remove remove flatten-clean clean clean ``` ## 项目结构 - matrix-dependencies-bom matrix项目依赖管理 - matrix-spring-boot-starters starters 集合 - matrix-swagger2 swagger2 依赖pom - matrix-parent starter 父项目 - matrix-common 公共封装 - matrix-utils 工具类集合 ## 发布中央仓库 ```bash mvn clean deploy -P release ``` ## 使用 1. 项目中引入parent ```xml com.github.winyiwin matrix-spring-boot-starter-parent ${latest.version} ``` > 引入parent之后 2. 若子项目需要上传nexus时需要一并添加源码则需要在该子项目下添加单独配置 ```xml maven-source-plugin ``` 3. application.yml或bootstrap.yml等配置文件配置激活spring.profiles.active > 可使用框架自带的maven配置profileActive激活,也可自定义环境 ```yaml spring: profiles: active: @profileActive@ ``` 4. main jar 设置 ```xml ${project.name} org.springframework.boot spring-boot-maven-plugin ``` 5. swagger ```xml com.github.winyiwin matrix-spring-boot-starter-dubbo com.github.winyiwin matrix-spring-boot-starter-web ``` 两个依赖分别提供dubbo 和 web的swagger , dubbo 目前使用的nacos,请自行更换 http://localhost:9999/doc.html ![knif4j](https://images.gitee.com/uploads/images/2021/0121/172134_bd4588ac_484241.png "屏幕截图.png") http://localhost:9999/swagger-ui.html ![swagger](https://images.gitee.com/uploads/images/2021/0121/172230_f52b5fab_484241.png "屏幕截图.png")