# tsingxiao-cloud-code-generate
**Repository Path**: tsingxiao/tsingxiao-cloud-code-generate
## Basic Information
- **Project Name**: tsingxiao-cloud-code-generate
- **Description**: 代码生成服务
- **Primary Language**: Java
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2020-06-05
- **Last Updated**: 2021-06-05
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### 目录:
- [技术栈说明](#技术栈说明)
- [项目开发和运行](#项目开发和运行)
- [SonarQube使用说明](#sonarqube使用说明)
* [Maven+SonarQube使用](#mavensonarqube使用)
- [热部署](#热部署)
* [方法](#方法)
* [springloaded说明:](#springloaded说明)
* [JRebel](#JRebel)
### 技术栈说明
本项目是maven构建的多模块项目
* 后端开发框架: Spring-boot2
* ORM工具: Mybatis
* 项目构建工具: Maven3
* 数据库: Postgresql12
* 前端服务端渲染框架: Nuxtjs(Vuejs) v2
* IDE:Intellij Idea
* 项目协作和持续交付(devops): 阿里云的云效
* 其他技术:
* Springloaded热部署
* SonarQube静态代码分析工具v7.8
* Jacoco测试覆盖率
### 项目开发和运行
在IDE中可以同单模块项目一样直接调试和运行。如果需要操作命令行,需先在项目根路径下执行:
```
mvn clean install -P dev -Dmaven.test.skip=true -Dmaven.javadoc.skip=true
```
`-P`参数表示profile,默认是dev。然后在api模块路径下执行:
```
mvn spring-boot:run -P dev
```
`-P`参数表示profile,默认是dev
查看本地swagger文档: http://localhost:8080/swagger-ui.html
### SonarQube使用说明
官方文档:https://docs.sonarqube.org/7.8/
#### Maven+SonarQube使用
##### 方法一:
本地maven安装目录conf/settings.xml文件中profiles节点下添加配置
- SonarQube服务地址
- 本地地址: http://localhost:9000
- 账户名和密码:
- 本地默认: admin:admin
- 线上: 联系管理员开通
```xml
sonar
true
http://localhost:9000
admin
admin
```
### 热部署
项目使用`springloaded`实现开发热部署
#### 方法
- 将springloaded-1.2.8.RELEASE.jar包(项目中已提供)放置在本地自定义目录下,如:\springloaded\springloaded-1.2.8.RELEASE.jar
- 在IDE中配置JVM启动参数:
``` bash
-javaagent:\springloaded\springloaded-1.2.8.RELEASE.jar -noverify
```
- 在IDE中启动程序
- 任何子项目产生了java代码的修改,只需要在其子项目根目录下运行
```bash
mvn compile
```
即可生效。如:api运行当中修改了api依赖的模块service中的代码,则执行操作:
```
cd /
mvn compile
```
修改即可生效
- springloaded官方声明的生效范围:
```
Spring Loaded allows you to add/modify/delete methods/fields/constructors.
The annotations on types/methods/fields/constructors can also be modified and it is possible to add/remove/change values in enum types.
```
#### springloaded说明:
https://github.com/spring-projects/spring-loaded
**注意事项:**
springloaded会监听classpath中声明的类文件变化,
如在IDE中以热部署方式同时启动mini-api和pc-api,且依赖的公共模块的类文件路径相同,
则对公共模块的修改会导致此修改对两个服务同时生效。
如需要同时启动两个服务且隔离此影响,需要自行将公共依赖进行复制和隔离
### JRebel
热部署工具JRebel:
[JRebel文档](https://manuals.jrebel.com/jrebel/index.html)