# quickstart-project-archetype **Repository Path**: AgentStudio/quickstart-project-archetype ## Basic Information - **Project Name**: quickstart-project-archetype - **Description**: 快速开发简单项目的原型项目模板。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-11-24 - **Last Updated**: 2022-11-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 项目介绍 ## 背景 通过开发一些项目之后,我发现每个项目中总会有一些“类似的东西”,比如说: - 项目结构(编程风格统一) - 配置文件(MyBatis、MVC、application.yml等) - 公共库(工具类、统一异常处理、统一响应处理等) 如何才能复用这些“东西”,快速构建一个新的项目呢?答案是 ## 实现思路 ![](images/构建archetype.png) 实现步骤: 1. 创建复用项目 2. 在项目的根目录创建 archetype.properties 3. 构建项目骨架(注释:在项目根目录) `mvn archetype:create-from-project -Darchetype.properties=./archetype.properties` 4. 安装骨架项目模板 ```shell #进入到这个目录 cd target/generated-sources/archetype/ #安装到本地仓库 mvn install ``` 5. 添加到idea 6. 创建新项目 参考资料 - 构建步骤:https://maven.apache.org/archetype/maven-archetype-plugin/examples/create-with-property-file.html - archetype.properties: https://maven.apache.org/archetype/maven-archetype-plugin/examples/create-with-property-file.html - 构建多模块的步骤:https://maven.apache.org/archetype/maven-archetype-plugin/examples/create-multi-module-project.hmlt - 高级玩法:https://maven.apache.org/archetype/archetype-models/archetype-descriptor/archetype-descriptor.html