티스토리 뷰
Gradle Build
./gradlew build -x test
Error 내용
Configuration on demand is an incubating feature.
> Task :batch:bootJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':batch:bootJar'.
> Error while evaluating property 'mainClass' of task ':batch:bootJar'
> Failed to calculate the value of task ':batch:bootJar' property 'mainClass'.
> Main class name has not been configured and it could not be resolved
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
Main 클래스가 없어서 발생하는 오류
해결방법
1. Main클래스 추가하기
2. 애플리케이션이 아니라면 Main 삭제
Main 클래스 추가하기
package com.tistory.api
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
@SpringBootApplication
class ApiApplication
fun main(args: Array<String>) {
runApplication<ApiApplication>(*args)
}
애플리케이션이 아니라면 Main 안쓰게 설정
bootRun.enabled = false
bootJar.enabled = false
jar.enabled = true
끝
'Error' 카테고리의 다른 글
Spring: No primary or single unique constructor found for interface java.util.List, requestparam (0) | 2023.02.15 |
---|
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- BASE64
- Knowhow
- spring
- HelloWorld
- Scala
- 사용법
- ActiveRecord
- RubyOnRails
- vscode
- Snippet
- sample
- Kotlin
- cdn
- Source
- 노가다
- enum
- error
- Algorithm
- index
- Mac
- URLEncode
- JQuery
- git
- version
- urldecode
- golang
- gradle
- js
- Regex
- ChatGPT
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함