asciidoctor / asciidoctorj

:coffee: Java bindings for Asciidoctor. Asciidoctor on the JVM!
http://asciidoctor.org
Apache License 2.0
627 stars 172 forks source link

asciidoctorj-diagram 1.5.9 : "(NameError) cannot load Java class ... DefaultAttributesPreprocessor" #661

Open bric3 opened 6 years ago

bric3 commented 6 years ago

Upgrading asciidoctorj-diagram in build.gradle to 1.5.9 make our build fail. Using version 1.5.8 fixes the issue.

➜./gradlew --no-daemon asciidoctor

<edited>

> Task :asciidoctor FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':asciidoctor'.
> (NameError) cannot load Java class org.springframework.restdocs.asciidoctor.DefaultAttributesPreprocessor

* 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 20s
11 actionable tasks: 1 executed, 10 up-to-date

Gradle : 4.8.1 OS: Mac OSX 10.13.5 JDK: HotSpot 1.8.0_172-b11 asciidoctorj-diagram : 1.5.9 asciidoctorj : 1.5.7 asciidoctor-gradle-plugin : 1.5.7

Build log with info and stacktraces

Using info and stacktraces, I can see that JRuby is having some issue to load the Spring preprocessor. I noticed a few interesting bits here :

  1. The version that asciidoc finds is 1.5.6, while it has been set to 1.5.7.

    Applying dependency management to configuration 'asciidoctor' in project 'service-a'
    [Asciidoctor] asciidoctorj: 1.5.6
    [Asciidoctor] asciidoctorj-groovy-dsl: 1.0.0.Alpha2
  2. The stacktrace suggest JRuby fails to see load the DefaultAttributesPreprocessor class of a jar, but succeed to load RestDocsExtensionRegistry.

    Caused by: java.lang.ClassNotFoundException: > org.springframework.restdocs.asciidoctor.DefaultAttributesPreprocessor at org.jruby.javasupport.JavaSupportImpl.loadJavaClass(JavaSupportImpl.java:154)

       <edited>
    
        at org.jruby.Ruby.evalScriptlet(Ruby.java:458)
        at org.asciidoctor.extension.JavaExtensionRegistry.javaImport(JavaExtensionRegistry.java:218)
        at org.asciidoctor.extension.JavaExtensionRegistry.preprocessor(JavaExtensionRegistry.java:49)
        at org.springframework.restdocs.asciidoctor.RestDocsExtensionRegistry.register(RestDocsExtensionRegistry.java:32)
        at org.asciidoctor.extension.internal.ExtensionRegistryExecutor.registerAllExtensions(ExtensionRegistryExecutor.java:21)
        at org.asciidoctor.internal.JRubyAsciidoctor.registerExtensions(JRubyAsciidoctor.java:118)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:84)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:75)
        at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:681)
        at org.asciidoctor.Asciidoctor$Factory$create.call(Unknown Source)
        at org.asciidoctor.gradle.AsciidoctorTask.withAsciidoctor(AsciidoctorTask.groovy:877)

The full log :

➜./gradlew --no-daemon asciidoctor --stacktrace --info
Initialized native services in: /Users/b.dutheil/.gradle/native
Using 4 worker leases.
Starting Build
Settings evaluated using settings file '/Users/b.dutheil/company/services/service-a/settings.gradle'.
Using local directory build cache for the root build (location = /Users/b.dutheil/.gradle/caches/build-cache-1, removeUnusedEntriesAfter = 7 days).
Projects loaded. Root project using build file '/Users/b.dutheil/company/services/service-a/build.gradle'.
Included projects: [root project 'service-a']

> Configure project :
Evaluating root project 'service-a' using build file '/Users/b.dutheil/company/services/service-a/build.gradle'.
[ant:unjar] Expanding: /Users/b.dutheil/.gradle/caches/modules-2/files-2.1/com.company.service.common/common-gradle/3.4.0/28192a70452a1ada83bfff4a4cd6a005f1747a84/common-gradle-3.4.0.jar into /Users/b.dutheil/company/services/service-a/build/gradle
Applying dependency management to configuration 'annotationProcessor' in project 'service-a'
Applying dependency management to configuration 'apiElements' in project 'service-a'
Applying dependency management to configuration 'archives' in project 'service-a'
Applying dependency management to configuration 'compile' in project 'service-a'
Applying dependency management to configuration 'compileClasspath' in project 'service-a'
Applying dependency management to configuration 'compileOnly' in project 'service-a'
Applying dependency management to configuration 'default' in project 'service-a'
Applying dependency management to configuration 'implementation' in project 'service-a'
Applying dependency management to configuration 'jacocoAgent' in project 'service-a'
Applying dependency management to configuration 'jacocoAnt' in project 'service-a'
Applying dependency management to configuration 'runtime' in project 'service-a'
Applying dependency management to configuration 'runtimeClasspath' in project 'service-a'
Applying dependency management to configuration 'runtimeElements' in project 'service-a'
Applying dependency management to configuration 'runtimeOnly' in project 'service-a'
Applying dependency management to configuration 'testAnnotationProcessor' in project 'service-a'
Applying dependency management to configuration 'testCompile' in project 'service-a'
Applying dependency management to configuration 'testCompileClasspath' in project 'service-a'
Applying dependency management to configuration 'testCompileOnly' in project 'service-a'
Applying dependency management to configuration 'testImplementation' in project 'service-a'
Applying dependency management to configuration 'testRuntime' in project 'service-a'
Applying dependency management to configuration 'testRuntimeClasspath' in project 'service-a'
Applying dependency management to configuration 'testRuntimeOnly' in project 'service-a'
Resolving global dependency management for project 'service-a'
Applying dependency management to configuration 'protobuf' in project 'service-a'
Applying dependency management to configuration 'testProtobuf' in project 'service-a'
Applying dependency management to configuration 'asciidoctor' in project 'service-a'
[Asciidoctor] asciidoctorj: 1.5.6
[Asciidoctor] asciidoctorj-groovy-dsl: 1.0.0.Alpha2
Applying dependency management to configuration 'integrationTestCompile' in project 'service-a'
Applying dependency management to configuration 'integrationTestImplementation' in project 'service-a'
Applying dependency management to configuration 'integrationTestRuntime' in project 'service-a'
Applying dependency management to configuration 'integrationTestCompileOnly' in project 'service-a'
Applying dependency management to configuration 'integrationTestCompileClasspath' in project 'service-a'
Applying dependency management to configuration 'integrationTestAnnotationProcessor' in project 'service-a'
Applying dependency management to configuration 'integrationTestRuntimeOnly' in project 'service-a'
Applying dependency management to configuration 'integrationTestRuntimeClasspath' in project 'service-a'
Applying dependency management to configuration 'integrationTestProtobuf' in project 'service-a'
Configuring agent
Applying dependency management to configuration 'protobufToolsLocator_protoc' in project 'service-a'
------------------------------------------------------------------------
Detecting the operating system and CPU architecture
------------------------------------------------------------------------
os.detected.name=osx
os.detected.arch=x86_64
os.detected.classifier=osx-x86_64
Applying dependency management to configuration 'protobufToolsLocator_grpc' in project 'service-a'
Resolving dependency management for configuration 'compile' of project 'service-a'
Errors occurred while build effective model from /Users/b.dutheil/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.16/88efb1b8d3d993fe339e9e2b201c75eed57d4c65/log4j-1.2.16.pom:
    'build.plugins.plugin[io.spring.gradle.dependencymanagement.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. in log4j:log4j:1.2.16
Excluding [javax.inject:javax.inject]
All projects evaluated.
Selected primary task 'asciidoctor' from project :
Tasks to be executed: [task ':extractIncludeProto', task ':extractProto', task ':generateProto', task ':compileJava', task ':processResources', task ':classes', task ':extractIncludeIntegrationTestProto', task ':extractIntegrationTestProto', task ':generateIntegrationTestProto', task ':compileIntegrationTestJava', task ':processIntegrationTestResources', task ':integrationTestClasses', task ':integrationTest', task ':asciidoctor']
:extractIncludeProto (Thread[Task worker for ':',5,main]) started.

> Task :extractIncludeProto UP-TO-DATE
Resolving dependency management for configuration 'compileClasspath' of project 'service-a'
Resolving dependency management for configuration 'compileOnly' of project 'service-a'
Resolving dependency management for configuration 'implementation' of project 'service-a'
Excluding []
Build cache key for task ':extractIncludeProto' is 7f42af530688f865186a90d01e166655
Caching disabled for task ':extractIncludeProto': Caching has not been enabled for the task
Skipping task ':extractIncludeProto' as it is up-to-date.
:extractIncludeProto (Thread[Task worker for ':',5,main]) completed. Took 0.233 secs.
:extractProto (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :extractProto UP-TO-DATE
Excluding []
Build cache key for task ':extractProto' is 041951723edba5d68a2060ccdc1c4763
Caching disabled for task ':extractProto': Caching has not been enabled for the task
Skipping task ':extractProto' as it is up-to-date.
:extractProto (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.019 secs.
:generateProto (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :generateProto UP-TO-DATE
Resolving dependency management for configuration 'protobufToolsLocator_protoc' of project 'service-a'
Excluding []
Resolving dependency management for configuration 'protobufToolsLocator_grpc' of project 'service-a'
Excluding []
Build cache key for task ':generateProto' is f513d36a2b24a57b81c2d5179662c6b3
Caching disabled for task ':generateProto': Caching has not been enabled for the task
Skipping task ':generateProto' as it is up-to-date.
:generateProto (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.05 secs.
:compileJava (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :compileJava UP-TO-DATE
Resolving dependency management for configuration 'annotationProcessor' of project 'service-a'
Excluding []
Build cache key for task ':compileJava' is 2ea4dcd47409078e5bc313e7d0cba264
Skipping task ':compileJava' as it is up-to-date.
:compileJava (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.308 secs.
:processResources (Thread[Task worker for ':' Thread 2,5,main]) started.

> Task :processResources UP-TO-DATE
Build cache key for task ':processResources' is b992cc78fdf904b60689fa94c6e09070
Caching disabled for task ':processResources': Caching has not been enabled for the task
Skipping task ':processResources' as it is up-to-date.
:processResources (Thread[Task worker for ':' Thread 2,5,main]) completed. Took 0.006 secs.
:classes (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :classes UP-TO-DATE
Skipping task ':classes' as it has no actions.
:classes (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.
:extractIncludeIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :extractIncludeIntegrationTestProto UP-TO-DATE
Resolving dependency management for configuration 'integrationTestCompile' of project 'service-a'
Excluding []
Resolving dependency management for configuration 'integrationTestCompileClasspath' of project 'service-a'
Resolving dependency management for configuration 'integrationTestCompileOnly' of project 'service-a'
Resolving dependency management for configuration 'integrationTestImplementation' of project 'service-a'
Excluding []
Build cache key for task ':extractIncludeIntegrationTestProto' is 05eeda504aa988b4136bc32327cb29e1
Caching disabled for task ':extractIncludeIntegrationTestProto': Caching has not been enabled for the task
Skipping task ':extractIncludeIntegrationTestProto' as it is up-to-date.
:extractIncludeIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.681 secs.
:extractIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :extractIntegrationTestProto UP-TO-DATE
Excluding []
Build cache key for task ':extractIntegrationTestProto' is 66d2a5450570ce1745c44e17462c6f47
Caching disabled for task ':extractIntegrationTestProto': Caching has not been enabled for the task
Skipping task ':extractIntegrationTestProto' as it is up-to-date.
:extractIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.003 secs.
:generateIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :generateIntegrationTestProto NO-SOURCE
Skipping task ':generateIntegrationTestProto' as it has no source files and no previous output files.
:generateIntegrationTestProto (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.001 secs.
:compileIntegrationTestJava (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :compileIntegrationTestJava UP-TO-DATE
Excluding []
file or directory '/Users/b.dutheil/company/services/service-a/proto/generated/integrationTest/java', not found
Build cache key for task ':compileIntegrationTestJava' is bc77e89ec0a201e40f58d07da15fe09f
Skipping task ':compileIntegrationTestJava' as it is up-to-date.
:compileIntegrationTestJava (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.201 secs.
:processIntegrationTestResources (Thread[main,5,main]) started.

> Task :processIntegrationTestResources UP-TO-DATE
Build cache key for task ':processIntegrationTestResources' is 4b6325b6e01a947230fa66832466d2d2
Caching disabled for task ':processIntegrationTestResources': Caching has not been enabled for the task
Skipping task ':processIntegrationTestResources' as it is up-to-date.
:processIntegrationTestResources (Thread[main,5,main]) completed. Took 0.057 secs.
:integrationTestClasses (Thread[main,5,main]) started.

> Task :integrationTestClasses UP-TO-DATE
Skipping task ':integrationTestClasses' as it has no actions.
:integrationTestClasses (Thread[main,5,main]) completed. Took 0.0 secs.
:integrationTest (Thread[main,5,main]) started.

> Task :integrationTest UP-TO-DATE
Resolving dependency management for configuration 'integrationTestRuntimeClasspath' of project 'service-a'
Resolving dependency management for configuration 'integrationTestRuntimeOnly' of project 'service-a'
Resolving dependency management for configuration 'integrationTestRuntime' of project 'service-a'
Resolving dependency management for configuration 'runtime' of project 'service-a'
Excluding []
Resolving dependency management for configuration 'jacocoAgent' of project 'service-a'
Excluding []
Build cache key for task ':integrationTest' is e3a25b3a6d124b13d2dee80daec9534a
Caching disabled for task ':integrationTest': 'JaCoCo agent configured with `append = true`' satisfied
Skipping task ':integrationTest' as it is up-to-date.
:integrationTest (Thread[main,5,main]) completed. Took 0.304 secs.
:asciidoctor (Thread[main,5,main]) started.

> Task :asciidoctor
Build cache key for task ':asciidoctor' is 08eda7d3de8111c786b814c1e0cc06bf
Caching disabled for task ':asciidoctor': Caching has not been enabled for the task
Task ':asciidoctor' is not up-to-date because:
  Task has failed previously.
Resolving dependency management for configuration 'asciidoctor' of project 'service-a'
Excluding []

> Task :asciidoctor FAILED
:asciidoctor (Thread[main,5,main]) completed. Took 6.199 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':asciidoctor'.
> (NameError) cannot load Java class org.springframework.restdocs.asciidoctor.DefaultAttributesPreprocessor

* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':asciidoctor'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:110)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(SkipCachedTaskExecuter.java:105)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:131)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:343)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:212)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:65)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:52)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:379)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:352)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:37)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:345)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:275)
        at org.gradle.launcher.Main.doAction(Main.java:36)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.jruby.exceptions.RaiseException: (NameError) cannot load Java class org.springframework.restdocs.asciidoctor.DefaultAttributesPreprocessor
        at org.jruby.javasupport.JavaClass.for_name(org/jruby/javasupport/JavaClass.java:286)
        at org.jruby.javasupport.JavaUtilities.get_proxy_class(org/jruby/javasupport/JavaUtilities.java:34)
        at RUBY.block in java_import(uri:classloader:/jruby/java/core_ext/object.rb:49)
        at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2487)
        at RUBY.java_import(uri:classloader:/jruby/java/core_ext/object.rb:36)
        at RUBY.<main>(<script>:1)
Caused by: java.lang.ClassNotFoundException: org.springframework.restdocs.asciidoctor.DefaultAttributesPreprocessor
        at org.jruby.javasupport.JavaSupportImpl.loadJavaClass(JavaSupportImpl.java:154)
        at org.jruby.javasupport.JavaSupportImpl.loadJavaClassVerbose(JavaSupportImpl.java:163)
        at org.jruby.javasupport.JavaClass.forNameVerbose(JavaClass.java:271)
        at org.jruby.javasupport.JavaClass.for_name(JavaClass.java:286)
        at org.jruby.javasupport.Java.get_proxy_class(Java.java:386)
        at org.jruby.javasupport.JavaUtilities.get_proxy_class(JavaUtilities.java:34)
        at org.jruby.javasupport.JavaUtilities$INVOKER$s$1$0$get_proxy_class.call(JavaUtilities$INVOKER$s$1$0$get_proxy_class.gen)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:127)
        at org.jruby.runtime.InterpretedIRBlockBody.commonYieldPath(InterpretedIRBlockBody.java:141)
        at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:186)
        at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)
        at org.jruby.runtime.Block.yield(Block.java:165)
        at org.jruby.RubyArray.collect(RubyArray.java:2473)
        at org.jruby.RubyArray.map19(RubyArray.java:2487)
        at org.jruby.RubyArray$INVOKER$i$0$0$map19.call(RubyArray$INVOKER$i$0$0$map19.gen)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:536)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:278)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:79)
        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:84)
        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:429)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:360)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:84)
        at org.jruby.internal.runtime.methods.InterpretedIRMethod.INTERPRET_METHOD(InterpretedIRMethod.java:186)
        at org.jruby.internal.runtime.methods.InterpretedIRMethod.call(InterpretedIRMethod.java:173)
        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318)
        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:155)
        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:315)
        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)
        at org.jruby.ir.interpreter.Interpreter.INTERPRET_ROOT(Interpreter.java:107)
        at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:94)
        at org.jruby.ir.interpreter.Interpreter.execute(Interpreter.java:34)
        at org.jruby.ir.IRTranslator.execute(IRTranslator.java:42)
        at org.jruby.Ruby.evalScriptlet(Ruby.java:482)
        at org.jruby.Ruby.evalScriptlet(Ruby.java:458)
        at org.asciidoctor.extension.JavaExtensionRegistry.javaImport(JavaExtensionRegistry.java:218)
        at org.asciidoctor.extension.JavaExtensionRegistry.preprocessor(JavaExtensionRegistry.java:49)
        at org.springframework.restdocs.asciidoctor.RestDocsExtensionRegistry.register(RestDocsExtensionRegistry.java:32)
        at org.asciidoctor.extension.internal.ExtensionRegistryExecutor.registerAllExtensions(ExtensionRegistryExecutor.java:21)
        at org.asciidoctor.internal.JRubyAsciidoctor.registerExtensions(JRubyAsciidoctor.java:118)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:84)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:75)
        at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:681)
        at org.asciidoctor.Asciidoctor$Factory$create.call(Unknown Source)
        at org.asciidoctor.gradle.AsciidoctorTask.withAsciidoctor(AsciidoctorTask.groovy:877)
        at org.asciidoctor.gradle.AsciidoctorTask.processAsciidocSources(AsciidoctorTask.groovy:584)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute(StandardTaskAction.java:46)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
        at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:794)
        at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:761)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:131)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:120)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:99)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:77)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipCachedTaskExecuter.execute(SkipCachedTaskExecuter.java:105)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ResolveBuildCacheKeyExecuter.execute(ResolveBuildCacheKeyExecuter.java:66)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)
        at org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:91)
        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:59)
        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.run(EventFiringTaskExecuter.java:51)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:46)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:262)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$ExecuteTaskAction.execute(DefaultTaskExecutionGraph.java:246)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:136)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.execute(DefaultTaskPlanExecutor.java:201)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.executeWithTask(DefaultTaskPlanExecutor.java:192)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:130)
        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:74)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph.execute(DefaultTaskExecutionGraph.java:131)
        at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
        at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
        at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
        at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
        at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:343)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:212)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
        at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:115)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:77)
        at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:74)
        at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
        at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:38)
        at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:96)
        at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:74)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.run(RunAsBuildOperationBuildActionRunner.java:47)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:317)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:309)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:185)
        at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:97)
        at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
        at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:43)
        at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:46)
        at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:65)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:32)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
        at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
        at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:62)
        at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:34)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
        at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
        at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:31)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
        at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:46)
        at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:52)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:379)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:352)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:37)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:23)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:345)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:275)
        at org.gradle.launcher.Main.doAction(Main.java:36)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:60)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:37)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:31)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:108)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)

* Get more help at https://help.gradle.org

BUILD FAILED in 20s
11 actionable tasks: 1 executed, 10 up-to-date

build.gradle

buildscript {
    repositories {
        mavenLocal()
        maven {
            url 'http://nexus.company.com/nexus/content/groups/public'
        }
    }
    dependencies {
        classpath 'com.company.service.common:common-gradle:3.+'
        classpath 'com.netflix.nebula:nebula-project-plugin:3.4.1'
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7'
        classpath 'org.asciidoctor:asciidoctorj-diagram:1.5.9'
    }
    dependencies {
        delete "build/gradle"
        ant.unjar src: configurations.classpath.files.find { it.name.matches '.*common-gradle.*' }, dest: 'build/gradle'
    }
}

ext {
    lombokVersion = '1.18.0'

    springBootVersion = '1.5.8.RELEASE'
    hibernateValidatorVersion = '6.0.10.Final'
    jacksonVersion = '2.8.11'
    retrofitVersion = '2.4.0'
    okhttpVersion = '3.10.0'
    rxjava2Version = '2.1.14'

    // tests
    mockitoVersion = '2.7.0'
    assertjVersion = '3.10.0'
    junitVersion = '4.12'
    mockserverVersion = '5.3.0'
    restAssuredVersion = '2.9.0'
    springKafkaTest = '1.3.3.RELEASE'

    springRestDocs = '1.2.4.RELEASE'
}

apply from: "build/gradle/common.gradle"
// plugin ids cannot be used due to https://github.com/gradle/gradle/issues/1262
apply plugin: nebula.plugin.responsible.NebulaFacetPlugin // apply plugin: 'nebula.facet'
apply plugin: org.asciidoctor.gradle.AsciidoctorPlugin // apply plugin: 'org.asciidoctor.convert'

configurations.all {
    exclude group: "org.glassfish.jersey.media", module: "jersey-media-json-jackson";
    exclude group: "org.hibernate", module: "hibernate-validator"

    resolutionStrategy.cacheDynamicVersionsFor 2, 'hours'
}

facets {
    integrationTest
}

dependencies {
    compile "javax.validation:validation-api:2.0.1.Final"
    compile "org.hibernate.validator:hibernate-validator:$hibernateValidatorVersion"

    compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider"

    compile "org.springframework:spring-webmvc"
    compile "com.google.protobuf:protobuf-java"
    compile "io.grpc:grpc-stub"
    compile "io.grpc:grpc-protobuf"
    compile "com.googlecode.protobuf-java-format:protobuf-java-format:1.4"

    compile "com.squareup.retrofit2:retrofit:$retrofitVersion"
    compile "com.squareup.retrofit2:converter-jackson:$retrofitVersion"
    compile "com.squareup.retrofit2:converter-scalars:$retrofitVersion"
    compile "com.squareup.retrofit2:adapter-rxjava2:$retrofitVersion"
    compile "com.squareup.okhttp3:okhttp:$okhttpVersion"
    compile "com.squareup.okhttp3:logging-interceptor:$okhttpVersion"

    compile "com.fasterxml.jackson.core:jackson-core:$jacksonVersion"
    compile "com.fasterxml.jackson.core:jackson-annotations:$jacksonVersion"
    compile "com.fasterxml.jackson.core:jackson-databind:$jacksonVersion"
    compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jacksonVersion"
    compile "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion"
    compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:$jacksonVersion"
    compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonVersion"
    compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:$jacksonVersion"
    compile "com.fasterxml.jackson.module:jackson-module-parameter-names:$jacksonVersion"

    compile "io.reactivex.rxjava2:rxjava:$rxjava2Version"

    annotationProcessor "org.projectlombok:lombok:$lombokVersion"
    annotationProcessor "org.springframework.boot:spring-boot-configuration-processor:$springBootVersion"

    testCompile "junit:junit:$junitVersion"
    testCompile "org.mock-server:mockserver-netty:$mockserverVersion"
    testCompile "org.assertj:assertj-core:$assertjVersion"
    testCompile "org.mockito:mockito-core:$mockitoVersion"
    testCompile "com.squareup.okhttp3:mockwebserver:$okhttpVersion"

    integrationTestCompile "junit:junit:$junitVersion"
    integrationTestCompile "com.squareup.okhttp3:mockwebserver:$okhttpVersion"
    integrationTestCompile "org.assertj:assertj-core:$assertjVersion"
    integrationTestCompile "com.jayway.restassured:rest-assured:$restAssuredVersion"
    integrationTestCompile "org.mockito:mockito-core:$mockitoVersion"

    integrationTestCompile "org.springframework.kafka:spring-kafka-test:$springKafkaTest"

    integrationTestCompile "org.springframework.restdocs:spring-restdocs-core:$springRestDocs"
    integrationTestCompile "org.springframework.restdocs:spring-restdocs-restassured:$springRestDocs"

    // documentation
    asciidoctor "org.springframework.restdocs:spring-restdocs-asciidoctor:$springRestDocs"
}

ext {
    snippetsDir = file("$buildDir/generated-snippets/")
}

asciidoctorj {
    version = "1.5.7"
    noDefaultRepositories = true
}

asciidoctor {
    requires 'asciidoctor-diagram'
    options doctype: 'book'
    attributes = ['snippets'          : snippetsDir,
                  'source-highlighter': 'coderay',
                  'encoding'          : 'utf-8',
                  'version'           : project.version]
    sources {
        include 'index.adoc'
    }
    inputs.dir snippetsDir
    dependsOn integrationTest

    // enforce asciidoc processing
    // outputs.upToDateWhen { false }
}

integrationTest {
    outputs.dir snippetsDir
}

jar {
    dependsOn asciidoctor
    from("${asciidoctor.outputDir}/html5") {
        into 'static'
    }
}

build environment

➜./gradlew buildEnvironment
Starting a Gradle Daemon, 1 busy Daemon could not be reused, use --status for details

> Configure project :
currentGradleVersion: Gradle 4.8.1
minimumGradleVersion: Gradle 3.5
Errors occurred while build effective model from /Users/b.dutheil/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.16/88efb1b8d3d993fe339e9e2b201c75eed57d4c65/log4j-1.2.16.pom:
    'build.plugins.plugin[io.spring.gradle.dependencymanagement.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. in log4j:log4j:1.2.16

> Task :buildEnvironment

------------------------------------------------------------
Root project
------------------------------------------------------------

classpath
+--- com.company.service.common:common-gradle:3.+ -> 3.4.0
+--- com.netflix.nebula:nebula-project-plugin:3.4.1
|    +--- com.netflix.nebula:nebula-gradle-interop:0.5.0
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.0 -> 1.1.51
|    |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.1.51
|    |              \--- org.jetbrains:annotations:13.0
|    +--- com.netflix.nebula:nebula-core:4.0.1
|    |    +--- org.apache.commons:commons-lang3:3.4
|    |    \--- org.apache.httpcomponents:httpclient-cache:4.5.2
|    |         +--- org.apache.httpcomponents:httpclient:4.5.2
|    |         |    +--- org.apache.httpcomponents:httpcore:4.4.4
|    |         |    +--- commons-logging:commons-logging:1.2
|    |         |    \--- commons-codec:commons-codec:1.9
|    |         \--- commons-logging:commons-logging:1.2
|    +--- com.netflix.nebula:nebula-publishing-plugin:5.1.5
|    +--- com.netflix.nebula:gradle-contacts-plugin:3.0.1
|    +--- com.netflix.nebula:gradle-dependency-lock-plugin:5.0.0
|    |    +--- com.netflix.nebula:nebula-gradle-interop:0.5.0 (*)
|    |    +--- com.netflix.nebula:gradle-scm-plugin:3.0.1
|    |    +--- com.netflix.nebula:nebula-dependency-base-plugin:0.1.0
|    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.0 -> 1.1.51 (*)
|    |    +--- org.codehaus.groovy.modules.http-builder:http-builder:0.7.1
|    |    |    +--- org.apache.httpcomponents:httpclient:4.2.1 -> 4.5.2 (*)
|    |    |    +--- net.sf.json-lib:json-lib:2.3
|    |    |    |    +--- commons-beanutils:commons-beanutils:1.8.0
|    |    |    |    |    \--- commons-logging:commons-logging:1.1.1 -> 1.2
|    |    |    |    +--- commons-collections:commons-collections:3.2.1
|    |    |    |    +--- commons-lang:commons-lang:2.4
|    |    |    |    +--- commons-logging:commons-logging:1.1.1 -> 1.2
|    |    |    |    \--- net.sf.ezmorph:ezmorph:1.0.6
|    |    |    |         \--- commons-lang:commons-lang:2.3 -> 2.4
|    |    |    +--- net.sourceforge.nekohtml:nekohtml:1.9.16
|    |    |    |    \--- xerces:xercesImpl:2.9.1
|    |    |    |         \--- xml-apis:xml-apis:1.3.04
|    |    |    \--- xml-resolver:xml-resolver:1.2
|    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.51 (*)
|    \--- com.netflix.nebula:gradle-info-plugin:3.6.0
|         +--- com.perforce:p4java:2015.2.1365273
|         |    \--- com.jcraft:jzlib:1.1.2
|         +--- com.netflix.nebula:gradle-contacts-plugin:3.0.1
|         +--- org.eclipse.jgit:org.eclipse.jgit:4.4.1.201607150455-r
|         |    +--- com.jcraft:jsch:0.1.53
|         |    +--- com.googlecode.javaewah:JavaEWAH:0.7.9
|         |    +--- org.apache.httpcomponents:httpclient:4.3.6 -> 4.5.2 (*)
|         |    \--- org.slf4j:slf4j-api:1.7.2
|         \--- org.tmatesoft.svnkit:svnkit:1.8.12
|              +--- com.jcraft:jsch.agentproxy.svnkit-trilead-ssh2:0.0.7
|              |    +--- com.trilead:trilead-ssh2:1.0.0-build217 -> 1.0.0-build220
|              |    \--- com.jcraft:jsch.agentproxy.core:0.0.7
|              +--- com.trilead:trilead-ssh2:1.0.0-build220
|              +--- net.java.dev.jna:jna-platform:4.1.0
|              |    \--- net.java.dev.jna:jna:4.1.0
|              +--- net.java.dev.jna:jna:4.1.0
|              +--- com.jcraft:jsch.agentproxy.connector-factory:0.0.7
|              |    +--- com.jcraft:jsch.agentproxy.core:0.0.7
|              |    +--- com.jcraft:jsch.agentproxy.usocket-jna:0.0.7
|              |    |    +--- com.jcraft:jsch.agentproxy.core:0.0.7
|              |    |    +--- net.java.dev.jna:jna:3.4.0 -> 4.1.0
|              |    |    \--- net.java.dev.jna:platform:3.4.0
|              |    +--- com.jcraft:jsch.agentproxy.usocket-nc:0.0.7
|              |    |    \--- com.jcraft:jsch.agentproxy.core:0.0.7
|              |    +--- com.jcraft:jsch.agentproxy.sshagent:0.0.7
|              |    |    \--- com.jcraft:jsch.agentproxy.core:0.0.7
|              |    \--- com.jcraft:jsch.agentproxy.pageant:0.0.7
|              |         +--- com.jcraft:jsch.agentproxy.core:0.0.7
|              |         +--- net.java.dev.jna:jna:3.4.0 -> 4.1.0
|              |         \--- net.java.dev.jna:platform:3.4.0
|              +--- de.regnis.q.sequence:sequence-library:1.0.3
|              \--- org.tmatesoft.sqljet:sqljet:1.1.10
|                   \--- org.antlr:antlr-runtime:3.4
+--- org.asciidoctor:asciidoctor-gradle-plugin:1.5.7
\--- org.asciidoctor:asciidoctorj-diagram:1.5.9
     \--- org.asciidoctor:asciidoctorj:1.5.7
          +--- org.jruby:jruby-complete:9.1.16.0
          \--- com.beust:jcommander:1.35

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 1m 2s
1 actionable task: 1 executed

asciidoctor task dependencies

➜ ./gradlew dependencie --configuration asciidoctor

> Configure project :
Errors occurred while build effective model from /Users/b.dutheil/.gradle/caches/modules-2/files-2.1/log4j/log4j/1.2.16/88efb1b8d3d993fe339e9e2b201c75eed57d4c65/log4j-1.2.16.pom:
    'build.plugins.plugin[io.spring.gradle.dependencymanagement.org.apache.maven.plugins:maven-antrun-plugin].dependencies.dependency.scope' for junit:junit:jar must be one of [compile, runtime, system] but is 'test'. in log4j:log4j:1.2.16

> Task :dependencies

------------------------------------------------------------
Root project
------------------------------------------------------------

asciidoctor
+--- org.springframework.restdocs:spring-restdocs-asciidoctor:1.2.4.RELEASE
+--- org.asciidoctor:asciidoctorj:1.5.7
|    +--- org.jruby:jruby-complete:9.1.16.0
|    \--- com.beust:jcommander:1.35
\--- org.asciidoctor:asciidoctorj-groovy-dsl:1.0.0.Alpha2
     +--- org.codehaus.groovy:groovy-all:2.3.9 -> 2.4.12
     \--- org.asciidoctor:asciidoctorj:1.5.2 -> 1.5.7 (*)

(*) - dependencies omitted (listed previously)

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 2s
1 actionable task: 1 executed
robertpanzer commented 6 years ago

I can imagine that this comes from the upgrade of JRuby from 1.7.x to 9.x.x.x together with Spring Boot. The new JRuby contains some changes regarding class loading and since has an own packaging format I could imagine that this is no longer compatible.

Imo this issue is better suited for the spring rest docs project unless it is reproducible with a build that is completely independent of sprint rest docs.

bric3 commented 6 years ago

@robertpanzer I didn't updated spring-* dependencies or any other, just asciidoctor ones.

robertpanzer commented 6 years ago

I did not mean that a spring dependency was updated, but that JRuby was most probably updated to another major version. And it seems like that the way Spring Boot handles class loading (of which I have no knowledge at all) is incompatible with this.

bric3 commented 6 years ago

I will verify this. But it is quite unlikely since gradle uses a specific classpath when the asciidoctor task is executed (look at the last snippet form the original ticket.

Also note that spring boot classloading has nothing to do in this as well, because documentation is read from files in the repository directories. spring-restdocs-asciidoctor only allows asciidoctor to understand some variables, this dependency contains 4 classes.

bric3 commented 6 years ago

@robertpanzer I created a very simple project, that demonstrate the issue. https://github.com/bric3/asciidoctorj-issue661

No spring (but the extension), no jruby dependencies, just asciidoctor. As said the extension contains 4 classes and has no dependencies : https://github.com/spring-projects/spring-restdocs/tree/v1.2.4.RELEASE/spring-restdocs-asciidoctor.

robertpanzer commented 6 years ago

It seems to work for me if I put the dependencies at the right place:

buildscript {
    repositories { jcenter() }
    dependencies {
        classpath 'org.asciidoctor:asciidoctor-gradle-plugin:1.5.7' 
    }
}
//...
dependencies {
    asciidoctor "org.springframework.restdocs:spring-restdocs-asciidoctor:$springRestDocs"
    asciidoctor 'org.asciidoctor:asciidoctorj-diagram:1.5.9'
}
//...
bric3 commented 6 years ago

oohhhhh

I hard a hard time to make diagrams to work because the example repo is out of date. My configuration was inspired by this issue https://github.com/asciidoctor/asciidoctor-gradle-examples/issues/15 especially and with other resources on the internet.

I don't know when it changed (or not), but the usage documentation should clearly be updated.

Anyway thanks for the tip !

robertpanzer commented 6 years ago

Hmmm... I can't really tell what the difference is, but adding the asciidoctor extensions to the script classpath looks wrong to me. It's subtle, but the Asciidoctor Gradle plugin creates an own Classloader to load AsciidoctorJ. Then bringing in an extension from the parent doesn't look right. (In the same way you already added spring-restdocs-asciidoctor to the asciidoctor configuration instead of adding it to the build class path)

I'm glad that we now found the problem, thanks for the reproducer :)

bric3 commented 6 years ago

Yeah it makes sense, but as it worked with 1.5.8, it looked weird. Maybe the exception message could be more meaningful, e.g. :

Did you place the asciidoctorj-* dependency in the asciidoctor configuration, otherwise it cannot see extensions.