Skip to content

fine-boot模块

  • 简化 SpringBoot 应用的初始搭建以及开发过程。

依赖

  • pom.xml
xml
<!--fine-boot-->
<dependency>
    <groupId>cn.finemap</groupId>
    <artifactId>fine-boot</artifactId>
    <version>${fine.version}</version>
</dependency>

配置

  • src/main/resources/application.yml
yaml
spring:
  profiles:
    active: dev #开发环境:dev
  application:
    name: fine-xxx # 服务名称
server:
  port: 80 # 端口
  servlet:
    context-path: /fine-xxx # 服务名称

创建子模块:fine-boot

  • 在fine-parent中创建:fine-boot子模块

fine-boot

  • 创建子模块:New > Module...
  • 添加公共组件的依赖
  • 设置框架标语
依赖
  • fine-boot/pom.xml
xml
<dependencies>
    <!--web-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <!--aop-->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
</dependencies>
设置框架标语
  • src/main/resources/banner.txt
   ████ ██                                               
  #██# ##                                         ██████ 
 ██████ ██ ███████   █████  ██████████   ██████  #██###██
###██# #██##██###██ ██###██##██##██##██ ######██ #██  #██
  #██  #██ #██  #██#███████ #██ #██ #██  ███████ #██████ 
  #██  #██ #██  #██#██####  #██ #██ #██ ██####██ #██###  
  #██  #██ ███  #██##██████ ███ #██ #██##████████#██     
  ##   ## ###   ##  ###### ###  ##  ##  ######## ##       

官方网站: http://www.finemap.cn
版权所有© 2020 北京凡图科技有限责任公司

维护父工程:fine-parent

fine-parent

  • 添加该子模块
  • 确认父工程中,锁定SpringBoot的版本
  • 在父工程中,管理版本参数
pom
  • fine-parent/pom.xml
xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>cn.finemap</groupId>
  <artifactId>fine-parent</artifactId>
  <version>1.0-RELEASE</version>
  <packaging>pom</packaging>
  <name>fine-parent</name>

  <!-- 版本参数 -->
  <properties>
    <fine.version>1.0-RELEASE</fine.version>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <java.version>17</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <!-- springboot -->
    <spring-boot.version>3.0.13</spring-boot.version>

  </properties>

  <!-- 依赖管理 -->
  <dependencyManagement>
    <dependencies>

      <!--springboot-->
      <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>${spring-boot.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

    </dependencies>
  </dependencyManagement>

  <!-- 子模块 -->
  <modules>
    <module>fine-boot</module>
  </modules>
</project>