1 Star 0 Fork 16

whhya / continew-starter

forked from ContiNew / continew-starter 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
LGPL-3.0

ContiNew Starter

License Release Release Codacy Badge Sonar Status Spring Boot Open JDK GitHub stars GitHub forks Gitee stars Gitee forks

简介

ContiNew Starter(Continue New Starter)基于“约定优于配置”的理念,再次精简常规配置,提供一个更为完整的配置解决方案,帮助开发人员更加快速的集成常用第三方库或工具到 Spring Boot Web 应用程序中。

ContiNew Starter 包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。

ContiNew Starter 源自 ContiNew Admin 中后台管理框架/脚手架项目。在 ContiNew Admin 发展到一定程度时,作者发现新手用户上手时需要关注过多的脚手架通用基础能力,而且如果想要在一个全新项目中使用这些基础能力,“迁移”起来也很麻烦。于是,ContiNew Starter 应运而生,作者在 ContiNew Admin 2.x 版本时,将项目中的通用基础能力进行了抽离和深度优化。这样,无论是在 ContiNew Admin 中使用,还是单独使用这些基础能力,都可以更加轻松。

解决痛点

在开发一个 Java Web 项目之前,我们可能需要做如下准备工作:

  1. 引入 Spring Boot 父项目进行版本锁定(无 Spring 不 Java)
  2. 引入 Spring Boot Web 依赖
  3. 根据自身需要引入不同组件的 Starter
  4. 根据自身需要对引入的 Starter 进行配置(查阅文档或通过搜索引擎查找常用配置)
    1. 编写 Java 配置
    2. 编写 application.yml 配置
  5. 编写各种全局处理器
  6. 开始使用

在 Spring Boot “约定优于配置” 理念的帮助下,我们开发一个 Spring Java Web 程序已经简化到了不可思议的程度,而且很多设计良好的组件 Starter 提供了极大的扩展性,提供了非常多的配置,给使用者最大的可行性,当你需要处理一些自定义场景时,这些配置简直是太过方便。

然而,极大的扩展性带来的另一面就是配置“混乱”,对于小白用户,初步使用某个组件时,仅配置就足够“吃一壶”。因此,各种脚手架项目应运而生,你可能会想,这基础配置关脚手架项目什么事?脚手架项目的作用不仅仅是提供一系列通用基础功能,更多的是提供了一种通用的解决方案,无论是针对所使用组件的配置,还是实现的某个功能的设计,亦或是开发规范 。即使是一个小白,把脚手架项目拿过来,只需要删减下不需要的功能,改动下品牌元素,就可以继续在其基础上进行开发一个成熟的项目。

ContiNew Starter 就是将脚手架项目中的通用基础配置进行了封装及深度优化,从企业通用实践层面精简配置,让一个完全从头开始或已有的项目,在使用部分组件时变得更轻松。

项目源码

开源平台 源码地址
GitHub https://github.com/Charles7c/continew-starter
Gitee(码云) https://gitee.com/continew/continew-starter

像数1,2,3一样容易

1.在项目 pom.xml 中锁定版本(下方两种方式请任选其一

第一种方式:如您使用的是 Spring Boot Parent 的方式,则替换 Spring Boot Parent 为 ContiNew Starter

<parent>
    <groupId>top.charles7c.continew</groupId>
    <artifactId>continew-starter</artifactId>
    <version>{latest-version}</version>
</parent>

第二种方式:如您使用的是引入 Spring Boot Dependencies 的方式,则替换 Spring Boot Dependencies 为 ContiNew Starter Dependencies

<properties>
    <java.version>17</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencyManagement>
    <dependencies>
        <!-- ContiNew Starter Dependencies -->
        <dependency>
            <groupId>top.charles7c.continew</groupId>
            <artifactId>continew-starter-dependencies</artifactId>
            <version>{latest-version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

2.在项目 pom.xml 中引入所需模块依赖

<dependencies>
    <!-- Web 模块 -->
    <dependency>
        <groupId>top.charles7c.continew</groupId>
        <artifactId>continew-starter-web</artifactId>
    </dependency>
</dependencies>

3.在 application.yml 中根据引入模块,添加所需配置

e.g. 跨域配置

--- ### 跨域配置
continew-starter.web:
  cors:
    enabled: true
    # 配置允许跨域的域名
    allowed-origins: '*'
    # 配置允许跨域的请求方式
    allowed-methods: '*'
    # 配置允许跨域的请求头
    allowed-headers: '*'
    # 配置允许跨域的响应头
    exposed-headers: '*'
抢先体验快照(SNAPSHOT)版本💡

注意: 快照版本目前处于开发测试阶段,其中很多特性或改动尚不稳定,可能会因为修复或优化而频繁调整。因此,仅可用于体验,切勿用于生产环境!

1.在项目 pom.xml 中配置 SNAPSHOT(快照)仓库地址(如果你已配有其他仓库地址,追加下方快照仓库地址即可)

<repositories>
    <repository>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
        <snapshots>
            <updatePolicy>always</updatePolicy>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>

2.将 ContiNew Starter 版本改为对应快照版本,例如:1.3.0-SNAPSHOT

模块结构

核心模块

模块名称 模块说明 依赖版本
continew-starter-core 核心模块:包含线程池、项目等自动配置 Spring Boot:3.1.8
Hutool:5.8.25
mica-ip2region:3.1.7

JSON模块

模块名称 模块说明 依赖版本
continew-starter-json-jackson Jackson 序列化等配置 Jackson:2.15.3

接口文档

模块名称 模块说明 依赖版本
continew-starter-api-doc Knife4j 自动配置 Knife4j:4.5.0

安全模块

模块名称 模块说明 依赖版本
continew-starter-security-password 密码编码器
continew-starter-security-mask JSON 脱敏
continew-starter-security-crypto 数据库字段加/解密
continew-starter-security-all

Web模块

模块名称 模块说明 依赖版本
continew-starter-web 跨域、全局异常、错误处理等自动配置 Undertow:2.3.10.Final
TLog:1.5.1

日志模块

模块名称 模块说明 依赖版本
continew-starter-log-core 日志核心模块
continew-starter-log-httptrace-pro Spring Boot Actuator HttpTrace 重置增强版

存储模块

模块名称 模块说明 依赖版本
continew-starter-storage-local 本地存储

文件处理模块

模块名称 模块说明 依赖版本
continew-starter-file-excel Excel 相关配置 Easy Excel:3.3.3

验证码模块

模块名称 模块说明 依赖版本
continew-starter-captcha-graphic 图形验证码 Easy Captcha:1.6.2
continew-starter-captcha-behavior 行为验证码 AJ-Captcha:1.3.0

缓存模块

模块名称 模块说明 依赖版本
continew-starter-cache-redisson Redisson 自动配置 Redisson:3.26.0
continew-starter-cache-springcache Spring Cache 自动配置
continew-starter-cache-jetcache JetCache 自动配置

数据访问模块

模块名称 模块说明 依赖版本
continew-starter-data-core 数据访问核心模块
continew-starter-data-mybatis-plus MyBatis Plus 自动配置 MyBatis Plus:3.5.5
dynamic-datasource-spring-boot-starter:4.3.0
P6Spy:3.9.1

认证模块

模块名称 模块说明 依赖版本
continew-starter-auth-satoken SaToken 自动配置 Sa-Token:1.37.0
continew-starter-auth-justauth JustAuth 自动配置 Just Auth:1.16.6

消息模块

模块名称 模块说明 依赖版本
continew-starter-messaging-mail 邮件 Jakarta Mail:1.1.0
continew-starter-messaging-sms 短信 SMS4J:3.1.1

扩展模块

模块名称 模块说明 依赖版本
continew-starter-extension-crud 扩展模块:BaseController 自定义 CRUD API 封装

贡献代码

分支说明

ContiNew Starter 的分支目前分为下个大版本的开发分支和上个大版本的维护分支,PR 前请注意对应分支是否处于维护状态。

分支 说明
dev 开发分支,默认为下个大版本的 SNAPSHOT 版本,接受新功能或新功能优化 PR
x.x.x 维护分支,在 vx.x.x 版本维护期终止前(一般为下个大版本发布前),用于修复上个版本的 Bug,只接受已有功能修复,不接受新功能 PR

流程步骤

如果您想提交新功能或优化现有代码,可以按照以下步骤操作:

  1. 首先,在 Gitee 或 Github 上将项目 fork 到您自己的仓库
  2. 然后,将 fork 过来的项目(即您的项目)克隆到本地
  3. 切换到当前仍在维护的分支(请务必充分了解分支使用说明,可进群联系维护者确认)
  4. 开始修改代码,修改完成后,将代码 commit 并 push 到您的远程仓库
  5. 在 Gitee 或 Github 上新建 pull request(pr),选择好源和目标,按模板要求填写说明信息后提交即可(多多参考 已批准合并的 pr 记录,会大大增加批准合并率)
  6. 最后,耐心等待维护者合并您的请求即可

请记住,如果您有任何疑问或需要帮助,我们将随时提供支持。

[!IMPORTANT] 欢迎大家为 ContiNew Starter 贡献代码,我们非常感谢您的支持!为了更好地管理项目,维护者有一些要求:

  1. 请确保代码、配置文件的结构和命名规范良好,完善的代码注释,并遵循阿里巴巴的 《Java开发手册(黄山版)》 中的代码规范,保证代码质量和可维护性
  2. 在提交代码前,请按照 Angular 提交规范 编写 commit 的 message(建议在 IntelliJ IDEA 中下载并安装 Git Commit Template 插件,以便按照规范进行 commit)
  3. 提交代码之前,请关闭所有代码窗口,执行 mvn compile 命令(代码格式化插件会在项目编译时对全局代码进行格式修正),编译通过后,不要再打开查看任何代码窗口,直接提交即可

反馈交流

💬 欢迎各位小伙伴儿扫描下方二维码加好友,备注 cnadmin,拉你进群,探讨技术、提提需求~

加入交流群后,你将会:

  • 第一时间收到框架动态
  • 第一时间收到框架更新通知
  • 第一时间收到框架 Bug 通知
  • 和众多大佬互相 (huá shuǐ) 交流 (mō yú)
二维码
无加群意愿 💬 如无加群意愿,欢迎在 Issues 中反馈交流~ 🍻

鸣谢

鸣谢

感谢参与贡献的每一位小伙伴🥰

特别鸣谢

License

GitHub Star 趋势

GitHub Star 趋势

GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (c) 2022-present Charles7c Authors. All Rights Reserved. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License. “The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”. The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.

简介

🔥高质量Starter🔥包含了一系列经过企业实践优化的依赖包(如 MyBatis-Plus、SaToken),可轻松集成到应用中,为开发人员减少手动引入依赖及配置的麻烦,为 Spring Boot Web 项目的灵活快速构建提供支持。 展开 收起
Java
LGPL-3.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/whhya/continew-starter.git
git@gitee.com:whhya/continew-starter.git
whhya
continew-starter
continew-starter
dev

搜索帮助