1 Star 0 Fork 2

绒花雪冷 / springboot-archetype-resources

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

SpringBoot Archetype

Spring Boot Archetype 将帮助你快速生成 Spring Boot 项目。

注意!

  • 不要直接运行本项目,本项目是制作maven archetype模板的模板
  • 本项目依赖于 Lombok 插件,请在 IDE 中安装 Lombok Plugin,安装步骤请自行百度

前置条件

特点

  • 基于 Spring Boot 2.2.2.RELEASE的多模块项目
  • 提供全局异常捕获、跨域访问、对返回数据进行封装等功能
  • 提供 Maven Profile 和 Spring Profile 完美融合的解决方案
  • 支持docker部署
  • 集成MyBatis、PageHelper
  • 支持多数据源配置
  • 使用FastJson替换Jackson进行JSON解析
  • 支持出入参、持久化时枚举类型的转换

运行

创建模板

第一步:将archetype打包发布到本地仓库

mvn clean install

从本地仓库删除

mvn dependency:purge-local-repository -DmanualInclude="com.jzdata:springboot-archetype"

第二步:生成Catalog文件

Catalog文件中包含了所有的Archetype,可以用来展示本地仓库中所有可以使用的archetype

mvn archetype:crawl

到此为止,项目模板就制作完成了,下面是使用方法

生成目标项目结构

方法一:直接指定好参数

参数 描述 默认值
archetypeGroupId 模板GroupId
archetypeArtifactId 模板ArtifactId
archetypeVersion 模板版本 1.0-SNAPSHOT
archetypeCatalog 插件默认的catalog的路径
interactiveMode 是否以交互的方式生成 true
groupId 目标项目GroupId
artifactId 目标项目ArtifactId
version 目标项目版本
package 目标项目根包名
mvn archetype:generate -DarchetypeGroupId=com.jzdata -DarchetypeArtifactId=springboot-archetype -DinteractiveMode=false -DarchetypeCatalog=local -DgroupId=com.test -DartifactId=test -Dversion=${version} -Dpackage=com.test

方法二:交互方式

mvn archetype:generate -DarchetypeCatalog=local

插件默认的catalog的路径为remote,local,即远程仓库和本地仓库的,为了构建的速度,直接将catalog的路径设置为本地仓库

控制台输出:

Choose archetype:
1: local -> com.jzdata:springboot-archetype (springboot)
2: local -> org.apache.maven.archetypes:maven-archetype-quickstart (quickstart)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 2:

在这里进行archetype的选择,选择完成后就是输入定义的参数,构建成功之后就可以用了

方法三:使用IDEA

第一步:File->New->Project...

image-20200529143712782

第二步:选择创建的maven模板

image-20200529144054857

第三步:填写项目基本信息image-20200529144520114

image-20200529144628649

完成以上的步骤之后,项目就创建完成了,项目结构如下:

image-20200529144903433

空文件

简介

springboot项目的maven模板 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/getready/springboot-archetype-resources.git
git@gitee.com:getready/springboot-archetype-resources.git
getready
springboot-archetype-resources
springboot-archetype-resources
master

搜索帮助