1.新建一个Spring的项目myasset-spring-boot-starter
项目结构如下:
注意:不需要Application启动类 和 application.yml/application.properties文件
2. resources下添加spring.factories文件
# Auto Configure
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.fdw.myassetspringbootstarter.config.MyAssetConfig
3.build.gradle配置
plugins {id 'java'id 'io.spring.dependency-management' version '1.0.11.RELEASE'
}// 配置仓库
repositories {maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}maven {url "https://maven.aliyun.com/nexus/content/groups/public/"}mavenCentral()gradlePluginPortal()mavenLocal()
}
dependencies {implementation 'org