springboot自定义springbootstart
1.前言
本文主要是介绍springboot如何创建springboot start,并且引入dependency使用
主要是通过读取配置文件的内容,并且使idea写我们自定的配置文件时有提示,自动补全功能,更容易去理解springboot start封装的内容
2.创建springboot start
2.1.新建项目read-properties-springboot-start
1.在
pom.xml
引入springboot依赖的parent,以及自定义start依赖
<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tianma</groupId>
<artifactId>read-properties-springboot-start</artifactId>
<version>1.0-SNAPSHOT</version>
<!--引入springboot启动依赖的paren-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent<