Contents

[Java]Spring REST Docs HTML이 생성되지 않을때

Contents

백기선님의 스프링부트 강좌를 수강하는중에 Spring REST Docs를 이용하여 HTML을 생성하려하는데, 아무리 빌드를 해도 ascii\html\index.html이 생성되지 않았습니다.

text

오후 11:58:18: Executing task 'build'...

> Task :compileJava
> Task :processResources
> Task :classes
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses

> Task :test
2019-12-02 23:58:35.629  INFO 24376 --- [       Thread-5] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-12-02 23:58:35.629  INFO 24376 --- [       Thread-7] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2019-12-02 23:58:35.630  INFO 24376 --- [       Thread-7] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-12-02 23:58:35.630  INFO 24376 --- [       Thread-5] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-12-02 23:58:35.630  INFO 24376 --- [       Thread-7] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
2019-12-02 23:58:35.630  INFO 24376 --- [       Thread-5] .SchemaDropperImpl$DelayedDropActionImpl : HHH000477: Starting delayed evictData of schema as part of SessionFactory shut-down'
2019-12-02 23:58:35.637  INFO 24376 --- [       Thread-5] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2019-12-02 23:58:35.642  INFO 24376 --- [       Thread-5] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.
2019-12-02 23:58:35.733 ERROR 24376 --- [       Thread-7] .SchemaDropperImpl$DelayedDropActionImpl : HHH000478: Unsuccessful: drop table event if exists
2019-12-02 23:58:35.734  INFO 24376 --- [       Thread-7] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown initiated...
2019-12-02 23:58:35.739  INFO 24376 --- [       Thread-7] com.zaxxer.hikari.HikariDataSource       : HikariPool-2 - Shutdown completed.

> Task :asciidoctor NO-SOURCE
> Task :bootJar
> Task :jar SKIPPED
> Task :assemble
> Task :check
> Task :build

BUILD SUCCESSFUL in 18s
5 actionable tasks: 5 executed
오후 11:58:36: Task execution finished 'build'.

cli를 들여다보니, 위와 같이 노출이 되는데 자세히 들여다보면 > Task :asciidoctor NO-SOURCE 가 있습니다.

의존성문제인줄알고 버전도 변경 하여 보고 build.gradle 파일의 코드가 잘못되었거나, 버전이 올라가면서 변경점이 있는지 체크해보았으나 다른점이 없어 검색을 하였더니 asciidoctor sourceDirectory가 Maven 플러그인에서는 src/main/asciidoc이지만, Gradle 플러그인은 sourceDirectory가 /src/docs/asciidoc 였습니다. 또한 Spring-REST-Docs에 의해 생성되는 경로도 아래 이미지와 같이 달랐습니다

JUnitRestDocumentation rule

Maven을 사용해 본 적이 없어서 gradle과 플러그인도 동일할줄 알았는데, 빌드 결과물도 다른 디렉토리에 생성되고 실행가능한 명령어들도 다른것을 알 수 있었습니다.

참고자료