Я пытаюсь создать 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