我尝试创建spring-boot-starter
. spring-boot module
我用这个 Gradle 文件创建了一个简单的文件:
plugins {
id 'org.springframework.boot' version '2.1.3.RELEASE'
id 'java'
}
apply plugin: 'io.spring.dependency-management'
group = 'my.domain'
version = '0.0.1-SNAPSHOT'
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
annotationProcessor "org.springframework.boot:spring-boot-autoconfigure-processor"
}
还有一类:
@SpringBootApplication
public class ApiSpringBootStarterApplication {
public static void main(String[] args) {
SpringApplication.run(ApiSpringBootStarterApplication.class, args);
}
}
它构建成功。但是如果我删除ApiSpringBootStarterApplication
类我会得到一个错误:
* What went wrong:
Execution failed for task ':api-spring-boot-starter:bootJar'.
> Main class name has not been configured and it could not be resolved