asciidoctor-maven-plugin
asciidoctor-maven-plugin copied to clipboard
Error500 after mvn site:run
Hello everyone,
I'm currently working on building a maven site from asciidoc documentations.
For that purpose I am using :
- asciidoctor.maven.plugin.version 1.5.3
- asciidoctorj.version 1.5.4.1
- maven-site-plugin 3.4 (Note that I am not toatlly free of the version I choose due to restrictions.)
The structure of my repository is: documentation |___ src ------|site -----------| asciidoc ------------------ mydoc.adoc ----------- site.xml |___ target (once built) ------|___site (has the html files) ------|___site-webapp pom.xml
The thing is, I manage to render asciidoc files to html in the target/site/ repository, however, whenever I run the site I get an error 500. I can see that the rendered files exist but they don't seem to be "joined".
Moreover, I noticed that while rendering with asciidoctor-maven-plugin the html file is not styled, contrary to the use of asciidoc-to-html.
Do you have any clue ? Thanks in advance
Can you confirm if the error you get is?
Error in custom provider, com.google.inject.OutOfScopeException: Cannot access Key[type=org.apache.maven.project.MavenProject, annotation=[none]] outside of a scoping block
at org.apache.maven.execution.scope.internal.MojoExecutionScopeModule.configure(MojoExecutionScopeModule.java:52) (via modules: org.eclipse.sisu.wire.WireModule -> org.apache.maven.execution.scope.internal.MojoExecutionScopeModule)
while locating org.apache.maven.project.MavenProject
while locating org.asciidoctor.maven.site.AsciidoctorParser
at ClassRealm[plugin>org.apache.maven.plugins:maven-site-plugin:3.4, parent: sun.misc.Launcher$AppClassLoader@55f96302] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
at ClassRealm[plugin>org.apache.maven.plugins:maven-site-plugin:3.4, parent: sun.misc.Launcher$AppClassLoader@55f96302] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule)
while locating org.apache.maven.doxia.parser.Parser annotated with @com.google.inject.name.Named(value=asciidoc)
That's the error 500 I get when running site:run
from the examples https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-maven-site-example.
If so, it seems we are messing some piece to fully integrate with the site module.
Moreover, I noticed that while rendering with asciidoctor-maven-plugin the html file is not styled, contrary to the use of asciidoc-to-html.
I get an exception in the console saying that it cannot access the default css, but they are there. Still, I have to say that the site goal is in not as complete as I'd like. If you are using other maven site features like reporting, ate least, you'll need to play with a custom css that integrates asciidoctor css into the one that maven site provides (see https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/166). On the other side, if you only plan to generate a site from asciidoctor with nothing else, I'd recommend using a site generation tool like https://github.com/asciidoctor/jekyll-asciidoc (Ruby) or http://jbake.org/docs/2.5.1/ (Java with also a maven plugin).
Indeed it is the error I have. Do you mean "missing" or "messing with"?
Okay, it seems I should take a look at your links as I just want a simple site.
Thank you for your answer.
Do you mean "missing" or "messing with"?
haha, missing, thanks for the tip.
With update maven-site-plugin to 3.7, maven-resources-plugin 2.7, maven-project-info-reports-plugin 2.9 in asciidoc-maven-site-example mvn site:run works fine, without issues with css.
@abelsromero @DnzzL I get exactly the same error. @slachiewicz I even tried the versions you mentioned, but the error 500 persists
I can't reproduce it now with the example I used before. It will help a lot if you can provide an example?
I'm talking about the asciidoc-maven-site folder. Whenever I run mvn site:run
I get the 500 error, exactly the same that you have mentioned above.
Can you confirm if the error you get is?
Error in custom provider, com.google.inject.OutOfScopeException: Cannot access Key[type=org.apache.maven.project.MavenProject, annotation=[none]] outside of a scoping block at org.apache.maven.execution.scope.internal.MojoExecutionScopeModule.configure(MojoExecutionScopeModule.java:52) (via modules: org.eclipse.sisu.wire.WireModule -> org.apache.maven.execution.scope.internal.MojoExecutionScopeModule) while locating org.apache.maven.project.MavenProject while locating org.asciidoctor.maven.site.AsciidoctorParser at ClassRealm[plugin>org.apache.maven.plugins:maven-site-plugin:3.4, parent: sun.misc.Launcher$AppClassLoader@55f96302] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule) at ClassRealm[plugin>org.apache.maven.plugins:maven-site-plugin:3.4, parent: sun.misc.Launcher$AppClassLoader@55f96302] (via modules: org.eclipse.sisu.wire.WireModule -> org.eclipse.sisu.plexus.PlexusBindingModule) while locating org.apache.maven.doxia.parser.Parser annotated with @com.google.inject.name.Named(value=asciidoc)
That's the error 500 I get when running
site:run
from the examples https://github.com/asciidoctor/asciidoctor-maven-examples/tree/master/asciidoc-maven-site-example.If so, it seems we are messing some piece to fully integrate with the site module.
Moreover, I noticed that while rendering with asciidoctor-maven-plugin the html file is not styled, contrary to the use of asciidoc-to-html.
I get an exception in the console saying that it cannot access the default css, but they are there. Still, I have to say that the site goal is in not as complete as I'd like. If you are using other maven site features like reporting, ate least, you'll need to play with a custom css that integrates asciidoctor css into the one that maven site provides (see #166). On the other side, if you only plan to generate a site from asciidoctor with nothing else, I'd recommend using a site generation tool like https://github.com/asciidoctor/jekyll-asciidoc (Ruby) or http://jbake.org/docs/2.5.1/ (Java with also a maven plugin).
I got the issue clear now, it seems a problem with Guice dependency injection. I'll see what else I can find, but also opened an issue upstream https://issues.apache.org/jira/browse/MSITE-849