1 2 Previous Next 25 Replies Latest reply on Jul 31, 2008 8:30 AM by Anne-Marie BARTHE

    Using jdocbook

    Naresh Bhatia Novice

      I am trying to use jdocbook with a maven project containing a very simple book. However when I invoke maven I get the following error message:

      [INFO] Cannot find lifecycle mapping for packaging: 'jdocbook'.
      Component descriptor cannot be found in the component repository:
       org.apache.maven.lifecycle.mapping.LifecycleMappingjdocbook.
      


      What am I doing wrong? Here's my POM:

      <project xmlns="http://maven.apache.org/POM/4.0.0"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      
       <modelVersion>4.0.0</modelVersion>
      
       <groupId>samples.book</groupId>
       <artifactId>book</artifactId>
       <version>1.0</version>
       <packaging>jdocbook</packaging>
      
       <name>My Book</name>
       <description>My Example Book</description>
      
       <build>
       <pluginManagement>
       <plugins>
       <plugin>
       <groupId>org.jboss.maven.plugins</groupId>
       <artifactId>maven-jdocbook-plugin</artifactId>
       <extensions>true</extensions>
       <configuration>
       <formats>
       <format>
       <formatName>pdf</formatName>
       </format>
       <format>
       <formatName>html</formatName>
       </format>
       </formats>
       </configuration>
       </plugin>
       </plugins>
       </pluginManagement>
       </build>
      
       <repositories>
       <repository>
       <id>jboss</id>
       <name>JBoss Repository</name>
       <url>http://repository.jboss.org/maven2</url>
       </repository>
       </repositories>
       <pluginRepositories>
       <pluginRepository>
       <id>jboss</id>
       <name>JBoss Repository</name>
       <url>http://repository.jboss.org/maven2</url>
       </pluginRepository>
       </pluginRepositories>
      
      </project>
      


        • 1. Re: Using jdocbook
          Paul Gier Master

          The lifecycle mapping for the jdocbook packaging type is picked up from the plugin. Since you have the plugin defined under , this pom is not actually loading that plugin, just managing it for child poms.

          Just take the plugins definition out of the pluginManagement section, and then maven should be able to find the jdocbook packaging type.

          • 2. Re: Using jdocbook
            Naresh Bhatia Novice

            Thanks Paul. I made the change to the pom. Also had to add the "sourceDocumentName" element to the configuration. However now I am getting a NullPointerException.

            java.lang.NullPointerException
             at org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:55)
             at org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:207)
             at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
             at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
             at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
             at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
             at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
             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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
             at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
             at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
             at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
            


            Am I missing some other configuration? As far as I can tell, I have added all the required elements. This is my latest pom:

            <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
            
             <modelVersion>4.0.0</modelVersion>
            
             <groupId>org.andromda</groupId>
             <artifactId>andromda-tutorial-java</artifactId>
             <version>3.2</version>
             <packaging>jdocbook</packaging>
            
             <name>AndroMDA Tutorial for Java</name>
             <description>AndroMDA Tutorial for Java</description>
            
             <build>
             <plugins>
             <plugin>
             <groupId>org.jboss.maven.plugins</groupId>
             <artifactId>maven-jdocbook-plugin</artifactId>
             <extensions>true</extensions>
             <configuration>
             <sourceDocumentName>Master.xml</sourceDocumentName>
             <formats>
             <format>
             <formatName>pdf</formatName>
             </format>
             <format>
             <formatName>html</formatName>
             </format>
             </formats>
             </configuration>
             </plugin>
             </plugins>
             </build>
            
             <repositories>
             <repository>
             <id>jboss</id>
             <name>JBoss Repository</name>
             <url>http://repository.jboss.org/maven2</url>
             </repository>
             </repositories>
             <pluginRepositories>
             <pluginRepository>
             <id>jboss</id>
             <name>JBoss Repository</name>
             <url>http://repository.jboss.org/maven2</url>
             </pluginRepository>
             </pluginRepositories>
            
            </project>
            


            • 3. Re: Using jdocbook
              Paul Gier Master

              You hit bug number 1 :)
              http://jira.jboss.com/jira/browse/MPJDOCBOOK-1

              Until this issue is resolved, you have to specify an options section in the configuration something like this

               <options>
               <xincludeSupported>false</xincludeSupported>
               </options>
              


              • 4. Re: Using jdocbook
                Naresh Bhatia Novice

                Great! That worked. Thanks Paul.

                BTW, I am planning to use this plugin for another open source project - andromda.org. Any pointers or cautions for me?

                I have few additional questions (I am a newbie to DocBook, so just let me know if these are DocBook related):

                - What is the intent of the war file generated in target/docbook folder? Is it meant to be a standalone website? Is it possible to suppress its generation?

                - I have a chapter with chapter id="Introduction". However the output contains files like ch01.html and ch01s02.html etc. Is it possible to name the output file Introduction.html?

                - I have a media object defined as follows:

                 <mediaobject>
                 <imageobject>
                 <imagedata fileref="../shared/images/AndromdaArchJava.jpg" format="JPG" align="right"/>
                 </imageobject>
                 </mediaobject>
                


                This is giving me a MalformedURLException. As far as I can tell, the latest Hibernate docs use the imagedata tag exactly this way. What am I doing wrong?

                SEVERE: Error with URL 'D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging/images/../shared/images/AndromdaArchJava.jpg': unknown protocol: d
                java.net.MalformedURLException: unknown protocol: d
                


                Thanks.
                Naresh

                • 5. Re: Using jdocbook
                  Naresh Bhatia Novice

                  Figured out question #2 on my own - the chapter filenames are controlled by the html_chunk style sheet while uses "use.id.as.filename" and "chunk.section.depth" to control the filenames.

                  • 6. Re: Using jdocbook
                    Steve Ebersole Apprentice

                    Ah lovely Windows! What's the stack trace for the MalformedURLException?

                    The war serves as the project's main artifact, which maven requires.

                    • 7. Re: Using jdocbook
                      Naresh Bhatia Novice

                      Here you go...

                      But before I forget, where is the source for hibernate-docbook-xslt?

                      java.net.MalformedURLException: unknown protocol: d
                       at java.net.URL.<init>(URL.java:574)
                       at java.net.URL.<init>(URL.java:464)
                       at org.apache.fop.apps.FOURIResolver.resolve(FOURIResolver.java:138)
                       at org.apache.fop.apps.FopFactory.resolveURI(FopFactory.java:638)
                       at org.apache.fop.apps.FOUserAgent.resolveURI(FOUserAgent.java:421)
                       at org.apache.fop.apps.FOUserAgent.resolveURI(FOUserAgent.java:395)
                       at org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:190)
                       at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:56)
                       at org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:432)
                       at org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:157)
                       at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:68)
                       at org.apache.fop.fo.FObj.processNode(FObj.java:118)
                       at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:321)
                       at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:185)
                       at com.icl.saxon.output.ContentHandlerProxy.startElement(ContentHandlerProxy.java:119)
                       at com.icl.saxon.output.ProxyEmitter.startElement(ProxyEmitter.java:81)
                       at com.icl.saxon.output.NamespaceEmitter.startElement(NamespaceEmitter.java:95)
                       at com.icl.saxon.output.GeneralOutputter.flushStartTag(GeneralOutputter.java:728)
                       at com.icl.saxon.output.GeneralOutputter.writeEndTag(GeneralOutputter.java:677)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:293)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLCallTemplate.process(XSLCallTemplate.java:187)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
                       at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLWhen.process(XSLWhen.java:72)
                       at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:255)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.LiteralResultElement.process(LiteralResultElement.java:289)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.Controller.defaultAction(Controller.java:271)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:236)
                       at com.icl.saxon.style.XSLApplyTemplates.process(XSLApplyTemplates.java:135)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLIf.process(XSLIf.java:78)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
                       at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
                       at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLOtherwise.process(XSLOtherwise.java:48)
                       at com.icl.saxon.style.XSLChoose.process(XSLChoose.java:96)
                       at com.icl.saxon.style.StyleElement.processChildren(StyleElement.java:634)
                       at com.icl.saxon.style.XSLTemplate.expand(XSLTemplate.java:225)
                       at com.icl.saxon.style.XSLTemplate.start(XSLTemplate.java:198)
                       at com.icl.saxon.Controller.applyTemplates(Controller.java:246)
                       at com.icl.saxon.Controller.run(Controller.java:178)
                       at com.icl.saxon.Controller.transformDocument(Controller.java:1086)
                       at com.icl.saxon.Controller.transform(Controller.java:953)
                       at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.render(BasicFormatHandler.java:130)
                       at org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:95)
                       at org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:207)
                       at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
                       at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
                       at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
                       at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
                       at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
                       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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                       at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                       at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                      


                      • 8. Re: Using jdocbook
                        Steve Ebersole Apprentice

                        Don't go by the stuff in Hibernate SVN. It is out of synch right now. Just go by the site docs for the jdocbook and jdocbook-style plugins.

                        I'm asking the docbook folks. It would appear that setting the docbook xslt param 'img.src.path' to a file path does not work for windows (at least with the version of fop and saxon I am using). Hopefully they will have some insight.

                        • 9. Re: Using jdocbook
                          Naresh Bhatia Novice

                          Steve, I have now switched to the jdocbook-style plugin. However the docs are not clear on how the two plugins work together. A simple example would be very helpful.

                          Anyway I have setup two maven projects right now: 1) andromda-docbook-style and 2) andromda-tutorial-java. POMs for the two projects are shown below:

                          <project xmlns="http://maven.apache.org/POM/4.0.0"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                          
                           <modelVersion>4.0.0</modelVersion>
                          
                           <groupId>org.andromda</groupId>
                           <artifactId>andromda-docbook-style</artifactId>
                           <version>3.2</version>
                           <packaging>jdocbook-style</packaging>
                          
                           <name>AndroMDA DocBook Style</name>
                           <description>AndroMDA DocBook Style</description>
                          
                           <build>
                           <plugins>
                           <plugin>
                           <groupId>org.jboss.maven.plugins</groupId>
                           <artifactId>maven-jdocbook-style-plugin</artifactId>
                           <extensions>true</extensions>
                           </plugin>
                           </plugins>
                           </build>
                          
                           <repositories>
                           <repository>
                           <id>jboss</id>
                           <name>JBoss Repository</name>
                           <url>http://repository.jboss.org/maven2</url>
                           </repository>
                           </repositories>
                           <pluginRepositories>
                           <pluginRepository>
                           <id>jboss</id>
                           <name>JBoss Repository</name>
                           <url>http://repository.jboss.org/maven2</url>
                           </pluginRepository>
                           </pluginRepositories>
                          
                          </project>
                          


                          <project xmlns="http://maven.apache.org/POM/4.0.0"
                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
                          
                           <modelVersion>4.0.0</modelVersion>
                          
                           <groupId>org.andromda</groupId>
                           <artifactId>andromda-tutorial-java</artifactId>
                           <version>3.2</version>
                           <packaging>jdocbook</packaging>
                          
                           <name>AndroMDA Tutorial for Java</name>
                           <description>AndroMDA Tutorial for Java</description>
                          
                           <dependencies>
                           <dependency>
                           <groupId>org.andromda</groupId>
                           <artifactId>andromda-docbook-style</artifactId>
                           <version>3.2</version>
                           <type>jdocbook-style</type>
                           </dependency>
                           </dependencies>
                          
                           <build>
                           <plugins>
                           <plugin>
                           <groupId>org.jboss.maven.plugins</groupId>
                           <artifactId>maven-jdocbook-plugin</artifactId>
                           <version>2.0.0</version>
                           <extensions>true</extensions>
                           <configuration>
                           <sourceDocumentName>Master.xml</sourceDocumentName>
                           <formats>
                           <format>
                           <formatName>pdf</formatName>
                           <stylesheetResource>classpath:/xslt/fopdf.xsl</stylesheetResource>
                           <finalName>andromda-tutorial-java.pdf</finalName>
                           </format>
                           <format>
                           <formatName>html</formatName>
                           <stylesheetResource>classpath:/xslt/html.xsl</stylesheetResource>
                           <finalName>index.html</finalName>
                           </format>
                           </formats>
                           <options>
                           <xincludeSupported>false</xincludeSupported>
                           </options>
                           </configuration>
                           </plugin>
                           </plugins>
                           </build>
                          
                           <repositories>
                           <repository>
                           <id>jboss</id>
                           <name>JBoss Repository</name>
                           <url>http://repository.jboss.org/maven2</url>
                           </repository>
                           </repositories>
                           <pluginRepositories>
                           <pluginRepository>
                           <id>jboss</id>
                           <name>JBoss Repository</name>
                           <url>http://repository.jboss.org/maven2</url>
                           </pluginRepository>
                           </pluginRepositories>
                          
                          </project>
                          


                          The andromda-docbook-style project runs fine. It packages my style sheets in a jar under /xslt. However when I run andromda-tutorial-java, I get the following error. What am I doing wrong?

                          [INFO] Scanning for projects...
                          [INFO] ----------------------------------------------------------------------------
                          [INFO] Building AndroMDA Tutorial for Java
                          [INFO] task-segment: [install]
                          [INFO] ----------------------------------------------------------------------------
                          [INFO] [jdocbook:resources]
                          [INFO] unpacking dependency resource [D:\m2\repository\org\andromda\andromda-docbook-style\3.2\andromda-docbook-style-3.2.jdocbook-style] to staging-dir [D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging]
                          [INFO] Expanding: D:\m2\repository\org\andromda\andromda-docbook-style\3.2\andromda-docbook-style-3.2.jdocbook-style into D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging
                          [INFO] [jdocbook:generate]
                          [INFO] ------------------------------------------------------------------------
                          [ERROR] FATAL ERROR
                          [INFO] ------------------------------------------------------------------------
                          [INFO] could not locate resource [classpath:/xslt/fopdf.xsl]
                          [INFO] ------------------------------------------------------------------------
                          [INFO] Trace
                          java.lang.IllegalArgumentException: could not locate resource [classpath:/xslt/fopdf.xsl]
                           at org.jboss.maven.plugins.jdocbook.gen.util.ResourceHelper.requireResource(ResourceHelper.java:31)
                           at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.resolveTransformationStylesheet(BasicFormatHandler.java:189)
                           at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.buildTransformer(BasicFormatHandler.java:165)
                           at org.jboss.maven.plugins.jdocbook.gen.format.BasicFormatHandler.render(BasicFormatHandler.java:126)
                           at org.jboss.maven.plugins.jdocbook.GenerationMojo.process(GenerationMojo.java:95)
                           at org.jboss.maven.plugins.jdocbook.AbstractDocBookMojo.execute(AbstractDocBookMojo.java:207)
                           at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:420)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
                           at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
                           at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330)
                           at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123)
                           at org.apache.maven.cli.MavenCli.main(MavenCli.java:272)
                           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.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                           at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                           at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                           at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                          


                          Note: I think usage.apt for jdocbook-style plugin has a typo:

                          <project>
                           <groupId>com.mygroup</groupId>
                           <artifact>myproject</artifactId>
                           <type>jdocbook-style</type>
                           ...
                          </project>
                          


                          Shouldn't the "type" element be replaced by

                           <packaging>jdocbook-style</packaging>
                          


                          "type" element is valid only in a dependency.

                          • 10. Re: Using jdocbook
                            Steve Ebersole Apprentice

                            try moving the style dependency inside the plugin configuration (this is the form i have been using, which I know works here):

                            ...
                            <plugin>
                             <dependencies>
                             <dependency>
                             <groupId>org.andromda</groupId>
                             <artifactId>andromda-docbook-style</artifactId>
                             <version>3.2</version>
                             <type>jdocbook-style</type>
                             </dependency>
                             </dependencies>
                            </plugin>
                            



                            • 11. Re: Using jdocbook
                              Naresh Bhatia Novice

                              That worked like a charm! Thanks.

                              Now the only remaining problem is the MalformedURLException, which I mentioned earlier. I have the following parameter defined in my stylesheet and FOP doesn't seem to like it.

                              <xsl:param name="html.stylesheet">../shared/css/html.css</xsl:param>
                              


                              One more question. Are these plugins intended for document generation only or also for a project site (replacing maven's site plugin and the xdoc format)?


                              • 12. Re: Using jdocbook
                                Steve Ebersole Apprentice

                                 

                                "nbhatia" wrote:
                                That worked like a charm! Thanks.

                                Either should work. The lookup uses the following paradigm to determine the classloader to use:
                                 ClassLoader loader = Thread.currentThread().getContextClassLoader();
                                 if ( loader == null ) {
                                 loader = ResourceHelper.class.getClassLoader();
                                 }
                                

                                So maven seems to not be setting up the classloader the way I would expect. Not too sure about that one. I'll have to ask the maven folks.

                                "nbhatia" wrote:

                                One more question. Are these plugins intended for document generation only or also for a project site (replacing maven's site plugin and the xdoc format)?

                                I only intend to use it for our reference manuals. I am sure it could be fitted to render sites pretty easily. In fact, Jason and I discussed that at one point.
                                BTW, the maven site generation facility allows other forms besides xdoc... There is even early support for simplified docbook.

                                • 13. Re: Using jdocbook
                                  Steve Ebersole Apprentice

                                  Just talked to one of the maven developers. This is expected behavior, and you will need to use this form for declaring the dependency for the jdocbook-style.

                                  • 14. Re: Using jdocbook
                                    Naresh Bhatia Novice

                                    Revisiting the MalformedURLException...

                                    SEVERE: Error with URL 'D:\ProjectsTest\DocBook\andromda-tutorial-java\target\staging/images/../shared/images/AndromdaArchJava.jpg':
                                    unknown protocol: d
                                    java.net.MalformedURLException: unknown protocol: d
                                    


                                    I see two issues with the build:

                                    1) I don't see images copied over from src\main\resources\shared\images to target

                                    2) The URL should probably have file:/// prepended to it. Xalan seems to be forgiving about this but saxon is not.

                                    1 2 Previous Next