Project
plugin org.asciidoctor.convert was not found 에러 해결
Nickolodeon
2023. 5. 5. 15:10
Introduction
새로운 프로젝트를 생성하면서 그동안의 Swagger 을 사용한 문서화 방식 대신 Spring REST docs 를 활용해보고자 했고, 이전에 사용하지 않은 플러그인을 추가했다.
개요
Gradle 로 빌드 시 발생한 에러를 자세히 읽어본 후 관련 코드를 찾아보다가 플러그인 중 ''org.asciidoctor.convert'' 가 추가된 것을 발견할 수 있었다.
해결
구글링을 하는 도중 asciidoctor 는 Spring Rest Docs 에서 사용하는 플러그인이라는 사실을 알게 되었다.
Spring Rest Docs 공식 문서에서는 다음과 같이 build.gradle 파일을 작성하라고 되어 있다.
plugins { (1)
id "org.asciidoctor.jvm.convert" version "3.3.2"
}
configurations {
asciidoctorExt (2)
}
dependencies {
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' (3)
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' (4)
}
ext { (5)
snippetsDir = file('build/generated-snippets')
}
test { (6)
outputs.dir snippetsDir
}
asciidoctor { (7)
inputs.dir snippetsDir (8)
configurations 'asciidoctorExt' (9)
dependsOn test (10)
}
1번부터 10번까지 중 고쳐야 했던 부분들은 아래와 같다:
(1) 나의 프로젝트의 경우에는 플러그인이 org.asciidoctor.convert 로 되어 있었고, 버전도 2.2.1 이었다.
(2) 나는 configurations 에 asciidoctorExt 가 아예 쓰여 있지 않았다.
(3) 마찬가지로 asciidoctor 의존성이 추가되어 있지 않았다.
(9) configurations 에 asciidoctorExt 가 없었던 것과 매한가지로 asciidoctor 가 설정되어 있지 않았다.
모두 고치고 나니 아래처럼 빌드가 성공적으로 되는 것을 확인할 수 있었다.
결론
공식 문서를 잘 확인하자 😂