# java-practices
**Repository Path**: youxiaxiaomage/java-practices
## Basic Information
- **Project Name**: java-practices
- **Description**: 🚀🚀🚀 Mybatis-Flex/Plus、Knife4j、Redisson、javers、drools、sa-token、liteflow、elasticjob等常用工具类
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: master
- **Homepage**: https://youxiaxiaomage.gitee.io/blog/
- **GVP Project**: No
## Statistics
- **Stars**: 24
- **Forks**: 16
- **Created**: 2022-12-01
- **Last Updated**: 2025-07-17
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
java-practices日常开发中的开发工具,编码技巧以及设计思想等,持续更新中
| 目录 | 说明 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| [`(有链接)yxxmg-mybatis-plus-sample`](./yxxmg-mybatis-plus-sample/readme.md) | 动态表名,`Mybatis-Plus`自定义枚举,`Mapstruct`,`JSR303`,`JSR330`,`Caffeine`,`Knife4j`,`Openfegin`,`JustAuth`,`Easy-Excel`,`Easy-ES` |
| `yxxmg-mybatis-flex-sample` | `mybatis-flex`新的`orm`框架,目前是`1.6.3`版本(目前版本可能存在问题,当前版本也是紧急修复的版本) |
| [`(有链接)yxxmg-pay-spring-boot-starter`](./yxxmg-pay-spring-boot-starter/readme.md) | `springboot`自动装配,`SPI`自定义支付`starter` |
| `yxxmg-drools-sample` | 规则引擎 |
| `yxxmg-java-helper` | `java`语法糖 |
| `yxxmg-spring-boot-sample` | `springboot`相关内容 |
| [`(有链接)yxxmg-flowable`](./yxxmg-flowable/README.md) | `flowable`工作流引擎,很多自定义功能设计 |
| `yxxmg-elasticjob` | `elasticjob`任务调度 |
| `yxxmg-smart-doc` | `smart-doc` |
| `yxxmg-exception-sample` | 自定义异常或国际化 |
| [`(有链接)yxxmg-sensitive-sample`](./yxxmg-sensitive-sample/readme.md) | `jackson`序列化与反序列化,例如字段脱敏,字符串去除首尾空格等 |
| `yxxmg-liteflow-sample` | `liteflow`服务编排 |
| `yxxmg-magic-api-sample` | `magic-api` |
| `yxxmg-event-sample` | `ApplicationEvent`,`ApplicationEventPublisher` |
| `yxxmg-javers-sample` | 对象前后变化对比(未开始) |
| `yxxmg-oos-sample` | 阿里云`oos` |
| [`(有链接)yxxmg-nlp-sample`](./yxxmg-nlp-sample/README.md) | `Stanford nlp` |
| `yxxmg-magic-api-sample` | `magic-api` |
| [`(有链接)yxxmg-gof-sample`](./yxxmg-gof-sample/README.md) | `Gof`23种设计模式,代码示例 |
| [`(有链接)yxxmg-distribute-redis-lock-sample`](./yxxmg-distribute-redis-lock-sample/readme.md) | `redis`实现分布式锁 |
| `yxxmg-sa-token-sample` | `sa-token`功能 |
| [`(有链接)yxxmg-dynamic-feign-sample`](./yxxmg-dynamic-feign-sample/readme.md) | 动态`feign` |
| [`(有链接)yxxmg-okhttp-sample`](./yxxmg-okhttp-sample/README.md) | `okhttp3` |
| [`(有链接)yxxmg-mybatis-spring-sample`](./yxxmg-mybatis-spring-sample/readme_zh.md) | `mybatis`基础研究 |
| [`(有链接)yxxmg-rabbitmq-sample`](./yxxmg-rabbitmq-sample/README.md) | 对生产者消费者进行了对应的`工厂模式+策略模式`的封装,扩展性极强, 动态创建`Queue`,`Exchange`,`Binding` |
| [`(有链接)yxxmg-websocket-sample`](./yxxmg-websocket-sample/README.md) | `springboot`集成`websocket` |
| [`(有链接)yxxmg-jwt-sample`](./yxxmg-jwt-sample/README.md) | |
| `yxxmg-easy-trans-sample` | `easy-trans` |
| `yxxmg-ip2region-sample` | 离线解析请求方ip地址 |
| `yxxmg-tess4j-sample` | 图片OCR文字识别,正确率不是100% |
| `yxxmg-redis-expire-sample` | redis缓存过期事件监听器 |
| [`(有链接)yxxmg-jetcache-sample`](./yxxmg-jetcache-sample/README.md) | 阿里缓存框架`jetcache` |
| `yxxmg-lock4j-sample` | `mp`团队分布式锁组件 |
| `yxxmg-archetype-sample` | `DDD`模板骨架 |
| `yxxmg-gateway-sample` | `SpringCloud Gateway` |
| [`yxxmg-flink-cdc-sample`](./yxxmg-flink-cdc-sample/README.md) | `flink cdc mysql binlog` |
| yxxmg-itextpdf-sample | itextpdf相关操作 |
#### 开发工具Idea
#### 开发中常用插件
1. lombok 简化代码,一般idea会集成,有些版本不自带,需要手动配置
2. MybatisX mybatis快速开发定位
3. Save Actions 自动保存,以及格式化代码需要配合代码风格插件使用
4. Code for Eclipse Code Formater eclipse代码风格
5. Maven Helper 用于Maven管理
6. Arthas Idea Plugin 性能工具
7. Key Promoter X 快捷键
8. Rainbow Brackets 代码括号彩虹色,方便看代码
9. Alibaba Java Coding Guidelines 阿里代码检视
10. CamelCase 驼峰命名变量 方法 类等
11. GitToolBox Git工具,方便提交更新代码等
12. RestfulToolKit 方便定位接口
13. Yapi 接口管理类似Knife4j
14. MeterSphere 接口自动化
15. Jenkins 流水线发版
16. xxl-job 分布式任务调度(light-task-scheduler)
17. Sonar Lint 代码漏洞
18. Confluence 文档管理 内部文档的传递
19. Comate,通义灵码,CodeGeeX,Copilot
20. DataX
21. Jpom
22. Jmeter
##### 使用的中间件
1. rabbitmq
2. activemq
3. kafka
4. elasticsearch
5. hbase
6. redis数据缓存以及基于Redisson实现的分布式锁
7. mongodb
##### 多环境打包
1. pom.xml配置
```xml
org.apache.maven.plugins
maven-compiler-plugin
1.8
1.8
org.springframework.boot
spring-boot-maven-plugin
2.7.5
true
repackage
org.apache.maven.plugins
maven-war-plugin
3.3.2
false
${project.artifactId}
${project.artifactId}
dev
dev
true
prod
prod
```
2. application.yml配置
```yaml
spring:
profiles:
active: @spring.profiles.active@
```
3. maven打包命令
```yaml
# 测试环境打包,默认方式dev
mvn clean package -P dev或mvn clean package
# 生产环境打包
mvn clean package -P prod
```