# acp **Repository Path**: zhangbinhub/acp ## Basic Information - **Project Name**: acp - **Description**: Application Construction Platform 应用构建平台。该项目是用Kotlin和Java语言混编封装的脚手架。本人会密切关注业界最新动态,并使用最新技术持续更新优化。使用该脚手架可快速搭建基于Kotlin或Java语言的普通应用、SpringBoot应用和SpringCloud应用。 - **Primary Language**: Kotlin - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 18 - **Forks**: 6 - **Created**: 2021-08-27 - **Last Updated**: 2025-09-01 ## Categories & Tags **Categories**: backend **Tags**: Kotlin, SpringBoot, SpringCloud, SpringCloudAlibaba, solon ## README # Application Construction Platform (ACP) [![Maven central](https://img.shields.io/maven-central/v/io.gitee.zhangbinhub.acp/acp-solon-dependency.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:io.gitee.zhangbinhub.acp%20AND%20a:acp-solon-dependency) [![Spring Boot](https://img.shields.io/badge/SpringBoot-3.5.x-brightgreen)](https://projects.spring.io/spring-boot) [![Spring Cloud](https://img.shields.io/badge/SpringCloud-2025.0.x-brightgreen)](https://projects.spring.io/spring-cloud) [![Spring Cloud Alibaba](https://img.shields.io/badge/SpringCloudAlibaba-2023.0.x-brightgreen)](https://github.com/alibaba/spring-cloud-alibaba) [![Solon](https://img.shields.io/badge/Solon-3.4.x-brightgreen)](https://gitee.com/opensolon/solon) [![Kotlin](https://img.shields.io/badge/Kotlin->=2.1-blue)](https://kotlinlang.org/) [![Jvm](https://img.shields.io/badge/Jvm->=17-blue)](http://hg.openjdk.java.net/) [![Gradle](https://img.shields.io/badge/Gradle->=8.6-blue)](https://gradle.org/) [![License](http://img.shields.io/badge/license-Apache%202-brightgreen)](http://www.apache.org/licenses/LICENSE-2.0.html) [![Security Status](https://www.murphysec.com/platform3/v31/badge/1671344589553876992.svg)](https://www.murphysec.com/console/report/1671344587179900928/1671344589553876992) ###### v2025.8.0 [版本更新日志](doc/version_history.md) ## 简介 致力于对业内主流的开源框架进行整合,达到方便易用快速开发的目的。 - 使用Kotlin语言开发; - 这不是个新轮子,而是组装各种优秀轮子; - 该项目旨在对业内各组件框架进行封装整合的脚手架,方便进行业务开发; - 使用该脚手架可快速开发基于Kotlin或Java语言的单体应用、Cloud应用; - 本人会密切关注业界最新动态,并使用最新技术持续更新优化; ## 版本说明 - **v2021.0.1.0** 开始,版本号命名规范改变,前三位大版本号与所使用的SpringCloud版本号一致,第三位小版本号迭代更新,同时将发布至Maven Central - **v2021.0.4.3** 开始,仅支持```java 11```版本,不再提供```java 1.8```版本 - tips: 如需```java 1.8```版本,自行下载源码编译,```project.properties```中修改为```javaVersion=1.8``` - **v2022.0.0.0** 开始,最低要求```java 17```版本 - **v2022.0.4.x** 最后一个版本为```2022.0.4.6```,不再有`2022.0.5.x`版本,之前的`2022.0.5.0-Mx` 预览版内容已全部合并进入`2022.0.4.6` - **v2024.0.0** 开始,适配[Solon](https://gitee.com/opensolon/solon) ,版本号命名规范改变:第1位版本号为发布时的年度,第2位版本号为功能更新,第3位版本号为bug修复及依赖更新 | Acp | Spring Cloud | Spring Boot | Solon | JVM | Spring Boot Alibaba | 新特性 | |:----------:|:-----------------:|:-----------:|:-----:|:---:|:-------------------:|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 2025.8.x | 2025.0.0 | 3.5.x | 3.5.x | 17+ | 2023.0.3.3 | | | 2025.7.x | 2025.0.0 | 3.5.x | 3.4.x | 17+ | 2023.0.3.3 | | | 2025.6.x | 2025.0.0 | 3.5.x | 3.4.x | 17+ | 2023.0.3.3 | | | 2025.5.x | 2025.0.0 | 3.5.x | 3.3.x | 17+ | 2023.0.3.3 | | | 2025.4.x | 2024.0.1 | 3.4.x | 3.3.x | 17+ | 2023.0.3.2 | | | 2025.3.x | 2024.0.1 | 3.4.x | 3.2.x | 17+ | 2023.0.3.2 | | | 2025.2.x | 2024.0.1 | 3.4.x | 3.1.x | 17+ | 2023.0.3.2 | | | 2025.1.x | 2024.0.0 | 3.4.x | 3.1.x | 17+ | 2023.0.3.2 | | | 2025.0.x | 2024.0.0 | 3.4.x | 3.0.x | 17+ | 2023.0.3.2 | | | 2024.3.x | 2023.0.4 | 3.3.x | 3.0.x | 17+ | 2023.0.3.2 | | | 2024.2.x | 2023.0.3 | 3.3.x | 3.0.x | 17+ | 2023.0.1.3 | | | 2024.1.x | 2023.0.3 | 3.3.x | 3.0.x | 17+ | 2023.0.1.2 | | | 2024.0.x | 2023.0.3 | 3.3.x | 2.9.x | 17+ | 2023.0.1.2 | | | 2023.0.3.x | 2023.0.3 | 3.3.x | - | 17+ | 2023.0.1.2 | | | 2023.0.2.x | 2023.0.2 | 3.3.x | - | 17+ | 2023.0.1.0 | | | 2023.0.1.x | 2023.0.1 | 3.2.x | - | 17+ | 2023.0.1.0 | | | 2023.0.0.x | 2023.0.0 | 3.2.x | - | 17+ | 2023.0.0.0-RC1 | | | 2022.0.4.x | 2022.0.4 | 3.1.x | - | 17+ | 2022.0.0.0 | | | 2022.0.3.x | 2022.0.3 | 3.1.x | - | 17+ | 2022.0.0.0 | | | 2022.0.2.x | 2022.0.2 | 3.1.x | - | 17+ | 2022.0.0.0-RC2 | | | 2022.0.1.x | 2022.0.1 | 3.0.x | - | 17+ | 2022.0.0.0-RC1 | | | 2021.0.5.x | 2021.0.5 | 2.7.x | - | 1.8 | 2021.0.4.x | | | 2021.0.4.x | 2021.0.4 | 2.7.x | - | 1.8 | 2021.0.4.x | | | 2021.0.3.x | 2021.0.3 | 2.7.x | - | 1.8 | 2021.0.1.x | | | 2021.0.2.x | 2021.0.2 | 2.6.x | - | 1.8 | 2021.0.1.x | | | 2021.0.1.x | 2021.0.1 | 2.6.x | - | 1.8 | 2021.0.1.x | | | 6.7.x | 2020.0.4 | 2.5.x | - | 1.8 | 2.2.x.RELEASE | | | 6.6.x | 2020.0.3 | 2.5.x | - | 1.8 | 2.2.x.RELEASE | | | 6.5.x | 2020.0.0~2020.0.2 | 2.4.x | - | 1.8 | 2.2.x.RELEASE | | ## 技术栈 | 分类 | 组件 | Spring技术栈 | Solon技术栈 | |-------|-----------|-----------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | 构建工具 | - | Gradle 8.6+ | Gradle 8.6+ | | 开发语言 | JVM | 17+ | 17+ | | | Java | 17+ | 17+ | | | Kotlin | 2.1+ | 2.1+ | | Core | 日期时间处理 | Joda Time | Joda Time | | | UUID | [uuid-creator](https://github.com/f4b6a3/uuid-creator) | [uuid-creator](https://github.com/f4b6a3/uuid-creator) | | | 加解密库 | bouncycastle | bouncycastle | | | PDF处理 | itextpdf
html2pdf | itextpdf
html2pdf | | | 文件压缩 | Zip4j | Zip4j | | Boot | WEB服务 | Undertow | [solon-boot-smarthttp(国产)](https://solon.noear.org/article/90) | | | http工具类 | RestClient
WebClient | [solon-net-httputils(国产)](https://solon.noear.org/article/770) | | | 日志框架 | slf4j
logback | slf4j
[solon-logging-logback](https://solon.noear.org/article/437) | | | Json处理 | Jackson | [Snack3(国产)](https://gitee.com/noear/snack3)
[solon-serialization-snack3](https://solon.noear.org/article/94) | | | Xml处理 | Jackson | Jackson
[solon-serialization-jackson-xml](https://solon.noear.org/article/763) | | | ORM框架 | 按需引入,例如:Hibernate (JPA) | 按需引入,例如:[MyBatis-Flex](https://gitee.com/mybatis-flex/mybatis-flex) | | | Api文档 | [Knife4j(国产)](https://doc.xiaominfo.com/)
Openapi3 | [Knife4j(国产)](https://doc.xiaominfo.com/)
[solon-openapi2-knife4j](https://solon.noear.org/article/568) | | | 安全框架 | [Sa-Token(国产)](https://sa-token.cc/index.html) | [Sa-Token(国产)](https://sa-token.cc/index.html) | | | 资源服务 | [Sa-Token(国产)](https://sa-token.cc/index.html)
sa-token-oauth2 | [sa-token-solon-plugin(国产)](https://solon.noear.org/article/110)
sa-token-oauth2 | | | 认证服务 | [Sa-Token(国产)](https://sa-token.cc/index.html)
sa-token-oauth2 | [sa-token-solon-plugin(国产)](https://solon.noear.org/article/110)
sa-token-oauth2 | | | 认证协议 | Oauth 2.0 | Oauth 2.0 | | | WebSocket | spring-boot-starter-websocket | [solon-boot-smarthttp(国产)](https://solon.noear.org/article/90)
[java-websocket-ns](https://solon.noear.org/article/644) | | | TCP/UDP | Netty | Netty | | | 校验 | spring-boot-starter-validation | [solon-security-validation(国产)](https://solon.noear.org/article/225) | | | Redis | spring-boot-starter-data-redis
spring-boot-starter-data-redis-reactive | [redisson-solon-plugin(国产)](https://solon.noear.org/article/533) | | | 工作流引擎 | [warm-flow(国产)](https://warm-flow.dromara.org/) | | | Cloud | 监控 | spring-boot-admin-server | [solon-admin-server(国产)](https://solon.noear.org/article/581) | | | 注册中心 | [Nacos(国产)](https://nacos.io/)
spring-cloud-starter-alibaba-nacos-discovery | [Nacos(国产)](https://nacos.io/)
[nacos2-solon-cloud-plugin](https://solon.noear.org/article/400) | | | 配置中心 | [Nacos(国产)](https://nacos.io/)
spring-cloud-starter-alibaba-nacos-config | [Nacos(国产)](https://nacos.io/)
[nacos2-solon-cloud-plugin](https://solon.noear.org/article/400) | | | 熔断/限流 | [Sentinel(国产)](http://sentinelguard.io/zh-cn/)
spring-cloud-starter-alibaba-sentinel
sentinel-datasource-nacos | [Sentinel(国产)](http://sentinelguard.io/zh-cn/)
[sentinel-solon-cloud-plugin](https://solon.noear.org/article/160) | | | 服务间调用 | spring-cloud-starter-openfeign
feign-hc5 | [nami](https://solon.noear.org/article/334) | | | 负载均衡 | spring-cloud-starter-loadbalancer | [CloudLoadBalance(国产)](https://solon.noear.org/article/793) | | | 消息总线 | Kafka
spring-cloud-starter-stream-kafka
spring-cloud-stream-binder-kafka-streams
spring-cloud-starter-bus-kafka | [Solon Cloud Event(国产)](https://solon.noear.org/article/family-solon-cloud-event)
Kafka
[kafka-solon-cloud-plugin](https://solon.noear.org/article/157) | | | 日志收集 | Kafka
spring-cloud-starter-stream-kafka
spring-cloud-stream-binder-kafka-streams | [Solon Cloud Event(国产)](https://solon.noear.org/article/family-solon-cloud-event)
Kafka
[kafka-solon-cloud-plugin](https://solon.noear.org/article/157) | | | 网关 | spring-cloud-starter-gateway | [solon-cloud-gateway(国产)](https://solon.noear.org/article/804) | | | 分布式锁 | 默认集成Redisson,需要自定义时实现`io.gitee.zhangbinhub.acp.cloud.lock.DistributedLock`接口即可 | 默认集成Redisson,需要自定义时实现`io.gitee.zhangbinhub.acp.cloud.lock.DistributedLock`接口即可 | | | 链路追踪 | 按需引入,例如:`opentelemetry` | 按需引入,例如:[zipkin-solon-cloud-plugin](https://solon.noear.org/article/525) | ## 一、gradle 脚本配置及使用 ### (一)配置文件 ##### 1.[gradle/libs.versions.toml](gradle/libs.versions.toml) 定义依赖库版本号 ##### 2.[gradle/globalTask.gradle](gradle/globalTask.gradle) 全局自定义任务配置,适用于顶层项目 ##### 3.[gradle/commonTask.gradle](gradle/commonTask.gradle) 公共自定义任务配置,适用于所有项目模块 ##### 4.[gradle/publishJar.gradle](gradle/publishJar.gradle) 发布任务配置,适用于`jar`项目模块 ##### 5.[gradle/publishPom.gradle](gradle/publishPom.gradle) 发布任务配置,适用于`pom`项目模块 ##### 6.[gradle/spring-app.gradle](gradle/spring-app.gradle) Spring Application 配置,适用于`spring`技术栈应用模块 ##### 7.[gradle/solon-app.gradle](gradle/solon-app.gradle) Spring Application 配置,适用于`solon`技术栈应用模块 ##### 8.[gradle/settings.gradle](settings.gradle) 定义项目/模块结构 ##### 9.[project.properties](project.properties) gradle全局参数: - gradleVersion:gradle版本号 - group:对应打包时的最外层`groupid`,最终的`groupid`还会加上模块路径,例如`groupid.acp` - version:项目版本号 - encoding:编译字符集 - mavenCentralUrl:maven中央仓库地址 - javaVersion:目标jvm版本号 ##### 10.[build.gradle](build.gradle) 公共构建脚本 ##### 11.模块根路径/build.gradle 单个模块特有的构建脚本 ### (二)自定义任务 - 全局自定义任务 - publishAll 发布所有构建至maven中央仓库,linux系统适用 - publishToMavenLocalAll 发布所有构建至maven本地仓库,linux系统适用 - 公共自定义任务 - clearPj 清理所有输出文件 - release 编译、打包并输出 - 如需编译打包对应环境,命令中使用参数 active,例如 ``` gradlew project:release -Pactive=test ``` ### (三)发布至maven仓库 ##### 1、发布至本地仓库 - 执行 publishToMavenLocal 任务 - publishToMavenLocalAll ##### 2、发布至私服 - 项目根路径下创建 gradle.properties 并添加如下参数(参数值根据实际情况修改) ``` mavenUploadUrlRelease=https://maven.com/repositories/releases/ mavenUploadUrlSnapshot=https://maven.com/repositories/snapshot/ mavenUserName=username mavenPassword=password ``` - 执行 publish 任务 - publishAll ##### 3、发布至中央仓库 - 项目根路径下创建 gradle.properties 并添加如下参数(参数值根据实际情况修改) ``` mavenUploadUrlRelease=https://maven.com/repositories/releases/ mavenUploadUrlSnapshot=https://maven.com/repositories/snapshot/ mavenUserName=username mavenPassword=password signing.keyId=shortId signing.password=keyPassword signing.secretKeyRingFile=keyFile ``` ### (四)升级命令 ``` gradlew wrapper --gradle-distribution-url=https://mirrors.cloud.tencent.com/gradle/gradle-8.13-all.zip ``` ## 二、工程结构 ``` acp(root) -------工程根目录,root模块 ├─ doc -------公共文档 ├─ excample -------测试模块根目录 │ ├─ solon-cloud -------Solon Cloud 测试模块 │ ├─ spring-cloud -------Spring Cloud 测试模块 │ ├─ testkotlin -------单体 Spring Boot Kotlin 测试模块 │ ├─ testreactive -------单体 Spring Boot WebFlux 测试模块 │ ├─ testspringboot -------单体 Spring Boot 测试模块 │ └─ testsolon -------单体 Solon Boot 测试模块 ├─ gradle -------gradle脚本 └─ modules -------子模块路径 ├─ core -------核心模块 ├─ dependency -------依赖模块 ├─ solon -------Solon Boot 和 Solon Cloud 适配模块 └─ spring -------Spring Boot 和 Spring Cloud 适配模块 ``` ## 三、模块说明 groupId: io.gitee.zhangbinhub.acp #### 1、依赖管理 位置:[**modules/dependency**](modules/dependency/README.md) #### 2、核心模块 位置:[**modules/core**](modules/core/README.md) #### 3、Spring技术栈模块 位置:[**modules/spring**](modules/spring/README.md) #### 4、Solon技术栈模块 位置:[**modules/solon**](modules/solon/README.md) ## 四、打包为 docker 镜像 - 打包:`buildImage` - 打包并上传:`pushImage` ## 五、使用 Acp 开发的项目 | | 单机版 | Cloud 微服务版 | 备注 | |--------------|----------------------------------------------------------------------------------------|------------------------------------------------------------------------------|-----------| | Spring 技术栈后端 | [acp-admin-standalone](https://gitee.com/zhangbinhub/acp-admin-standalone) | [acp-admin-cloud](https://gitee.com/zhangbinhub/acp-admin-cloud) | 管理系统,后端部分 | | Solon 技术栈后端 | [acp-admin-solon-standalone](https://gitee.com/zhangbinhub/acp-admin-solon-standalone) | [acp-admin-solon-cloud](https://gitee.com/zhangbinhub/acp-admin-solon-cloud) | 管理系统,后端部分 | | Vue 前端 | [acp-admin-standalone-web](https://gitee.com/zhangbinhub/acp-admin-standalone-web) | [acp-admin-cloud-web](https://gitee.com/zhangbinhub/acp-admin-cloud-web) | 管理系统,前端部分 |