{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/624","repository_url":"https://api.github.com/repos/spring-projects/spring-restdocs","labels_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/624/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/624/comments","events_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/624/events","html_url":"https://github.com/spring-projects/spring-restdocs/issues/624","id":457948948,"node_id":"MDU6SXNzdWU0NTc5NDg5NDg=","number":624,"title":"asciidoctor task fails because of missing projectdir attribute","user":{"login":"jnizet","id":1608223,"node_id":"MDQ6VXNlcjE2MDgyMjM=","avatar_url":"https://avatars3.githubusercontent.com/u/1608223?v=4","gravatar_id":"","url":"https://api.github.com/users/jnizet","html_url":"https://github.com/jnizet","followers_url":"https://api.github.com/users/jnizet/followers","following_url":"https://api.github.com/users/jnizet/following{/other_user}","gists_url":"https://api.github.com/users/jnizet/gists{/gist_id}","starred_url":"https://api.github.com/users/jnizet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnizet/subscriptions","organizations_url":"https://api.github.com/users/jnizet/orgs","repos_url":"https://api.github.com/users/jnizet/repos","events_url":"https://api.github.com/users/jnizet/events{/privacy}","received_events_url":"https://api.github.com/users/jnizet/received_events","type":"User","site_admin":false},"labels":[{"id":1237978674,"node_id":"MDU6TGFiZWwxMjM3OTc4Njc0","url":"https://api.github.com/repos/spring-projects/spring-restdocs/labels/status:%20waiting-for-triage","name":"status: waiting-for-triage","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-06-19T11:07:12Z","updated_at":"2019-06-19T15:28:59Z","closed_at":null,"author_association":"NONE","body":"This is a followup to #403.\r\n\r\nUsing spring-restdocs 2.0.4.BUILD-SNAPSHOT, with the `org.asciidoctor.convert:2.2.0` plugin or the `org.asciidoctor.jvm.convert:2.2.0` plugin, the asciidoctor task fails wil the following exception:\r\n\r\n```\r\n> Task :backend:asciidoctor\r\nException in thread \"main\" org.asciidoctor.gradle.remote.AsciidoctorRemoteExecutionException: Error running Asciidoctor whilst attempting to process /Users/jb/projects/amies-server/backend/src/main/asciidoc/index.adoc using backend html5\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_convertFiles_closure4.doCall(AsciidoctorJavaExec.groovy:87)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:104)\r\n        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:326)\r\n        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)\r\n        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)\r\n        at groovy.lang.Closure.call(Closure.java:411)\r\n        at groovy.lang.Closure.call(Closure.java:427)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2296)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2281)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2334)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.convertFiles(AsciidoctorJavaExec.groovy:78)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.access$1(AsciidoctorJavaExec.groovy)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_run_closure3.doCall(AsciidoctorJavaExec.groovy:70)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_run_closure3.call(AsciidoctorJavaExec.groovy)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2296)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2281)\r\n        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2322)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.run(AsciidoctorJavaExec.groovy:65)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec.main(AsciidoctorJavaExec.groovy:47)\r\nCaused by: java.lang.IllegalStateException: asciidoctor: FAILED: /Users/jb/projects/amies-server/backend/src/main/asciidoc/index.adoc: Failed to load AsciiDoc document\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.getRequiredAttribute(SnippetsDirectoryResolver.java:78)\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.getRequiredAttribute(SnippetsDirectoryResolver.java:68)\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.lambda$getGradleSnippetsDirectory$0(SnippetsDirectoryResolver.java:63)\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.getRequiredAttribute(SnippetsDirectoryResolver.java:76)\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.getGradleSnippetsDirectory(SnippetsDirectoryResolver.java:62)\r\n        at org.springframework.restdocs.asciidoctor.SnippetsDirectoryResolver.getSnippetsDirectory(SnippetsDirectoryResolver.java:39)\r\n        at org.springframework.restdocs.asciidoctor.DefaultAttributesAsciidoctorJ16Preprocessor.process(DefaultAttributesAsciidoctorJ16Preprocessor.java:36)\r\n        at org.asciidoctor.extension.processorproxies.PreprocessorProxy.process(PreprocessorProxy.java:95)\r\n        at org.asciidoctor.extension.processorproxies.PreprocessorProxy$INVOKER$i$2$0$process.call(PreprocessorProxy$INVOKER$i$2$0$process.gen)\r\n        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodTwoOrN.call(JavaMethod.java:1008)\r\n        at org.jruby.RubyMethod.call(RubyMethod.java:121)\r\n        at org.jruby.RubyMethod$INVOKER$i$call.call(RubyMethod$INVOKER$i$call.gen)\r\n        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrNBlock.call(JavaMethod.java:353)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)\r\n        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)\r\n        at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)\r\n        at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)\r\n        at org.jruby.runtime.Block.yield(Block.java:165)\r\n        at org.jruby.RubyArray.each(RubyArray.java:1792)\r\n        at org.jruby.RubyArray$INVOKER$i$0$0$each.call(RubyArray$INVOKER$i$0$0$each.gen)\r\n        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroBlock.call(JavaMethod.java:537)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82)\r\n        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:138)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:125)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:191)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:325)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:141)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:346)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.RubyMethod.call(RubyMethod.java:129)\r\n        at org.jruby.RubyMethod$INVOKER$i$call.call(RubyMethod$INVOKER$i$call.gen)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:547)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:138)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:125)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:191)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:325)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:141)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:346)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:207)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:367)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:203)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128)\r\n        at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151)\r\n        at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187)\r\n        at org.jruby.runtime.BlockBody.yield(BlockBody.java:116)\r\n        at org.jruby.runtime.Block.yield(Block.java:165)\r\n        at org.jruby.RubyIO.ensureYieldClose(RubyIO.java:1163)\r\n        at org.jruby.RubyIO.open(RubyIO.java:1157)\r\n        at org.jruby.RubyIO$INVOKER$s$0$0$open.call(RubyIO$INVOKER$s$0$0$open.gen)\r\n        at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:303)\r\n        at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:84)\r\n        at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:91)\r\n        at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:544)\r\n        at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362)\r\n        at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105)\r\n        at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92)\r\n        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:173)\r\n        at org.jruby.RubyClass.finvoke(RubyClass.java:888)\r\n        at org.jruby.runtime.Helpers.invoke(Helpers.java:442)\r\n        at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:374)\r\n        at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:488)\r\n        at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:469)\r\n        at org.asciidoctor.gradle.remote.AsciidoctorJavaExec$_convertFiles_closure4.doCall(AsciidoctorJavaExec.groovy:83)\r\n        ... 22 more\r\nCaused by: java.lang.IllegalStateException: asciidoctor: FAILED: <stdin>: Failed to load AsciiDoc document\r\n        ... 162 more\r\nCaused by: java.lang.IllegalStateException: projectdir attribute not found\r\n        ... 162 more\r\n```\r\n\r\nThis exception doesn't happen with the versions 1.5.9.2 and 1.6.0 of the `org.asciidoctor.convert` plugin.\r\n\r\nI checked that I don't use the projectdir attribute anywhere in my index.adoc document and in the generated snippets. \r\nI also checked that, if I don't use the spring-restdocs extension (to avoid the above exception), and add `gradle-projectdir = {gradle-projectdir}` to my index.adoc file, I get the expected value."},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/comments/503610316","html_url":"https://github.com/spring-projects/spring-restdocs/issues/624#issuecomment-503610316","issue_url":"https://api.github.com/repos/spring-projects/spring-restdocs/issues/624","id":503610316,"node_id":"MDEyOklzc3VlQ29tbWVudDUwMzYxMDMxNg==","user":{"login":"wilkinsona","id":914682,"node_id":"MDQ6VXNlcjkxNDY4Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/914682?v=4","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2019-06-19T15:28:59Z","updated_at":"2019-06-19T15:28:59Z","author_association":"MEMBER","body":"@jnizet I think I've tracked down the cause. Can you confirm that you're using the `operation` block macro from the extension?"}}
{"actor":{"display_login":"wilkinsona"}}