Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Auto Closed
-
None
-
None
-
None
-
windows, mvn2, mvn3
Description
When doxia validates invalid configuration file (for example chapter id is missing) validator adds correct message ("Each chapter has to have an id." ) to the list of errors.
Unfortunately this helpful message is lost for the end user and all she sees is:
[ERROR] Failed to execute goal org.apache.maven.doxia:doxia-maven-plugin:1.1.3:render-books (default-cli) on project XYZ : Error while generating book in format 'pdf'. Invalid book descriptor. -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.doxia:doxia-maven-plugin:1.1.3:render-books (default-cli) on project B24ZiiscB2GDocumentation: Error while generating book in format 'pdf'. at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:570) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:317) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:247) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:104) at org.sonatype.maven.shell.maven.MavenSystemImpl$MavenRuntimeImpl.doExecute(MavenSystemImpl.java:476) at org.sonatype.maven.shell.maven.MavenSystemImpl$MavenRuntimeImpl.execute(MavenSystemImpl.java:252) at org.sonatype.maven.shell.commands.maven.MavenCommand.execute(MavenCommand.java:425) at org.sonatype.gshell.execute.CommandExecutorImpl.execute(CommandExecutorImpl.java:175) at org.sonatype.gshell.parser.impl.visitor.ExecutingVisitor.visit(ExecutingVisitor.java:95) at org.sonatype.gshell.parser.impl.ASTExpression.jjtAccept(ASTExpression.java:18) at org.sonatype.gshell.parser.impl.SimpleNode.childrenAccept(SimpleNode.java:65) at org.sonatype.gshell.parser.impl.visitor.ExecutingVisitor.visit(ExecutingVisitor.java:75) at org.sonatype.gshell.parser.impl.ASTCommandLine.jjtAccept(ASTCommandLine.java:18) at org.sonatype.gshell.parser.CommandLineParserImpl$1.execute(CommandLineParserImpl.java:68) at org.sonatype.gshell.execute.CommandExecutorImpl.execute(CommandExecutorImpl.java:91) at org.sonatype.gshell.shell.ShellImpl.execute(ShellImpl.java:215) at org.sonatype.gshell.shell.ShellImpl$1$1.doExecute(ShellImpl.java:246) at org.sonatype.gshell.console.ConsoleTask.execute(ConsoleTask.java:108) at org.sonatype.gshell.console.Console.work(Console.java:198) at org.sonatype.gshell.console.Console.run(Console.java:135) at org.sonatype.gshell.shell.ShellImpl.run(ShellImpl.java:293) at org.sonatype.gshell.MainSupport.boot(MainSupport.java:279) at org.sonatype.maven.shell.Main.main(Main.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.sonatype.gshell.launcher.Launcher.launch(Launcher.java:76) at org.sonatype.gshell.launcher.Launcher.run(Launcher.java:48) at org.sonatype.gshell.launcher.Launcher.main(Launcher.java:39) Caused by: org.apache.maven.plugin.MojoExecutionException: Error while generating book in format 'pdf'. at org.apache.maven.doxia.plugin.DoxiaRenderBooksMojo.execute(DoxiaRenderBooksMojo.java:270) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:105) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:562) ... 29 more Caused by: org.apache.maven.doxia.book.InvalidBookDescriptorException: Invalid book descriptor. at org.apache.maven.doxia.book.DefaultBookDoxia.renderBook(DefaultBookDoxia.java:100) at org.apache.maven.doxia.plugin.DoxiaRenderBooksMojo.execute(DoxiaRenderBooksMojo.java:265) ... 31 more
Example of invalid configuration:
<?xml version="1.0" encoding="UTF-8"?> <book xmlns="http://maven.apache.org/BOOK/1.0.0" xmlns:xsi="htt//www.w3.org/2001/XMLSchema-instance" > <id>B2GServiceBook</id> <author>Ivica Loncar</author> <title>B2G servis</title> <chapters> <chapter> <title>Uvod</title> <sections> <section> <title>Uvod</title> <file>b2g/uvod.apt</file> </section> </sections> </chapter> </chapters> </book>
The validation failure message is most helpful and it should be presented to the user.