728x90
에러코드
1. asciidoctor를 못찾음
Could not find method configurations() for arguments [asciidoctorExtensions] on task ':asciidoctor' of type org.asciidoctor.gradle.AsciidoctorTask.
2. bootJar를 찾을 수 없음
Could not get unknown property 'copyDocument' for task ':bootJar'
문제상황
1. 문제가 발생한 gradle 내의 특정 라인을 가리켜주며, 위의 문제가 발생함
버전도 다 맞게 세팅되어있는데 저지랄임
2. 위의 문제를 해결했더니 기다리고 있던 2차 관문이었음
띄어쓰기도 다 맞고 왜 왜 왜 왜그러는데??
원인
1. 플러그인에 일반 asciidoctor.convert 사용
Spring Boot에서 자동 설정해온 타입이 아래의 타입이라 발생
(늘 그렇지만 내탓임. 하지만 이번엔 내탓 아님)
plugins {
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'org.asciidoctor.convert' version '1.5.8'
id 'java'
}
2. 오타하나 있었고, 순서를 잘못 설정함
(이번엔 내탓 맞음. 무지성 세팅의 잘못을 느낌. gradle도 순서가 중요하다는걸 깨달음)
bootJar {
dependsOn copyDocumenta // <= Documenta... a가 왜 붙어있어..
from ("${asciidoctor.outputDir}") {
into 'static/docs'
}
}
build {
dependsOn copyDocument
}
해결방법
1. ascuudictir.jvm.convert를 사용하자. jvm 달려있는거 쓰면 됨
plugins {
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'org.asciidoctor.jvm.convert' version '3.3.2'
id 'java'
}
2. 일단 오타 보내고, 그래도 안되면 순서를 의심해 봐야함. build에서 copyDoctument에 위임하고, bootJar를 시켜야함
(아 다르고 어 다르다는 말임. 여튼 내잘못)
build {
dependsOn copyDocument
}
bootJar {
dependsOn copyDocument
from ("${asciidoctor.outputDir}") { // adoc output 경로
into 'static/docs'
}
}
728x90
'Java & Spring > Error' 카테고리의 다른 글
[SpringBoot] httpmessagenotwritableexception 에러 (0) | 2022.11.17 |
---|---|
[SpringBoot] DataIntegrityViolationException (0) | 2022.11.14 |
[SpringBoot] failed to load applicationcontext (0) | 2022.11.02 |
[SpringBoot] jpasystemexception 예외 (0) | 2022.11.02 |
[SpringBoot] h2 localhost에서 연결을 거부했습니다. (0) | 2022.10.31 |