Issue Details (XML | Word | Printable)

Key: MOJO-693
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Carlos Sanchez
Reporter: Lars Trieloff
Votes: 3
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Mojo

DocBook Profiling Support

Created: 15/Mar/07 08:32 AM   Updated: 25/Jun/07 05:13 PM
Component/s: docbook
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Text File maven-docbook-profile.patch (58 kB)
2. Text File maven-docbook-profile.patch (51 kB)
3. Text File maven-docbook-profiling.patch (111 kB)
4. Text File maven-docbook-profiling.patch (52 kB)
5. Text File maven-docbook-profiling.patch (52 kB)
6. Text File MOJO-693.txt (155 kB)

Issue Links:
Supercedes
 

Complexity: Intermediate


 Description  « Hide
The following patch contains my previous patches (MOJO-617 MOJO-485 MOJO-484) for the docbook plugin and adds support for DocBook profiling. This allows to generate a Linux and a Windows version of the documentation from one single DocBook document.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Carlos Sanchez added a comment - 01/May/07 05:21 PM
I have spent a lot of time with this patch, cleaning up, complete changes formats, missing dependencies and all kinds of problems

It is a really bad idea to put together such massive amount of changes


Carlos Sanchez added a comment - 01/May/07 05:23 PM
Cleaned up patch and updated to current svn version

Carlos Sanchez added a comment - 01/May/07 05:35 PM
for some reason the xml files show up as completely changed in the patch although only the first line changes

Carlos Sanchez added a comment - 01/May/07 05:35 PM
With this patch I get this error

This is the error i'm getting now

$ mvn docbook:transform -e
+ Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'docbook'.
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - org.acegisecurity:acegi-security-doc:jar:1.1-SNAPSHOT
[INFO] task-segment: [docbook:transform]
[INFO] ----------------------------------------------------------------------------
Downloading: http://repository.codehaus.org/docbook/docbook-xsl/1.67.2/docbook-xsl-1.67.2.pom
Downloading: http://repo.mergere.com/maven2/docbook/docbook-xsl/1.67.2/docbook-xsl-1.67.2.pom
Downloading: http://repo.mergere.com/maven2/docbook/docbook-xsl/1.67.2/docbook-xsl-1.67.2.pom
Downloading: http://repository.codehaus.org/fop/fop/0.93/fop-0.93.pom
Downloading: http://repo.mergere.com/maven2/fop/fop/0.93/fop-0.93.pom
Downloading: http://repo.mergere.com/maven2/fop/fop/0.93/fop-0.93.pom
[INFO] [docbook:transform]
Cannot find CatalogManager.properties
[INFO] Loading olink database generation stylesheet
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to get a transformer instance from source resource://net/sourceforge/docbook/xhtml/docbook.xsl
unknown protocol: resource
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.RuntimeException: Unable to get a transformer instance from source resource://net/sourceforge/docbook/xhtml/docbook.xsl
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:172)
at org.codehaus.mojo.docbook.OLinkDBUpdater.update(OLinkDBUpdater.java:110)
at org.codehaus.mojo.docbook.TransformMojo.execute(TransformMojo.java:262)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
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:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
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:585)
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)
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:683)
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:168)
... 20 more
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:825)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:666)
... 21 more
Caused by: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:819)
... 22 more
Caused by: java.net.MalformedURLException: unknown protocol: resource
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5 seconds
[INFO] Finished at: Tue May 01 15:16:03 PDT 2007
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------


Lars Trieloff added a comment - 02/May/07 04:47 AM
It looks like the incorrect URL resolver is used. I will take a look at your changes later.

Ben Alex added a comment - 28/May/07 02:45 AM
Lars, do you have a timeframe for when you might be able to look at this?

Carlos has been trying to get this working on Acegi Security (which is trying to migrate to Maven 2) for a long time now and has provided a number of patches.

This one issue supersedes all prior issues for the DocBook plugin, and there is no viable alternative Maven 2 DocBook plugin, so this issue does seem to be well-worth the investment to get working and into a formal release.


Lars Trieloff added a comment - 28/May/07 01:10 PM
Ben, I am currently very much involved with a deadline in another open source project, so I can promise that I will not be able to look into this prior to June, 21, but will as soon as possible after the release.

Lars Trieloff added a comment - 07/Jun/07 03:42 PM
I just looked into the issue and found the cause of the problem: Carlos changed the dependencies of the plugin to use the version of the DocBook-XSL-Stylesheets that is available in the repository, which is packaged as a ZIP file.

The MojoURIResolver provided with my patch loads resource:// urls from classpath resources, and the default configuration expects a JAR file containing the docbook-xsl stylesheets as seen on http://releases.mindquarry.org/org/docbook/docbook-xsl/1.72.0/ to be present in the classpath. As this is not the case with the current depdendencies, the stylesheet cannot be loaded.

My patch reverts some of Carlos' changes to the depdendency management:


Carlos Sanchez added a comment - 07/Jun/07 04:16 PM
  • Xalan caused the problem stated in MOJO-775
  • we need to know the list of things to put in the repo
  • fop already has a pom in the repo that can not be changed
  • the patch is against and old revision and doesn't apply cleanly yet

Lars Trieloff added a comment - 07/Jun/07 04:25 PM

Carlos Sanchez added a comment - 07/Jun/07 04:55 PM
your patch says revision 3044, latest is 4022

Lars Trieloff added a comment - 08/Jun/07 01:48 AM
Looks like I added the wrong patch file. It looks like a proper version of FOP is already available in the repository, so the only missing dependency is the docbook-xsl.jar

Lars Trieloff added a comment - 11/Jun/07 02:26 AM
What are the chances of getting this patch applied? I would like to contribute some further patches building upon this like support for chunked HTML output, for text output and an option to use non PDF-native fonts.

Carlos Sanchez added a comment - 11/Jun/07 03:15 PM
the chances depend a lot on you, I have most of it applied, but
  • you need to add the license header to your new files for legal reasons
  • your path included changes to the xml files that shouldn't be changed (encoding issues?)
  • system.out is not very nice
  • I had to upload the dockbook jar and add minimal info to the pom, you can't repackage the docbook jar in a different way as they provide it and put it in org.docbook, so I removed the net/sourceforge/docbook subfolders and changed the code

Now I'm getting a MalformedURLException (I was playing with the resource:// values but I don't think that matters)

java.lang.RuntimeException: Unable to get a transformer instance from source resource://net/xhtml/docbook.xsl
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:170)
at org.codehaus.mojo.docbook.OLinkDBUpdater.update(OLinkDBUpdater.java:108)
at org.codehaus.mojo.docbook.TransformMojo.execute(TransformMojo.java:256)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
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:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
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:585)
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)
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:683)
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:166)
... 20 more
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:825)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:666)
... 21 more
Caused by: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:819)
... 22 more
Caused by: java.net.MalformedURLException: unknown protocol: resource
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7 seconds
[INFO] Finished at: Mon Jun 11 13:12:09 PDT 2007
[INFO] Final Memory: 8M/16M
[INFO] ------------------------------------------------------------------------

if you add the license headers in a new patch I think it's ready to be committed if you later look at the error


Lars Trieloff added a comment - 11/Jun/07 04:05 PM
Thank you. I will have a look tomorrow.

Lars Trieloff added a comment - 25/Jun/07 09:31 AM
Hm, this repackaging means the URL should be resource:// (because everything is then below, e.g. html/docbook.xsl) But this is no valid URL.

Lars Trieloff added a comment - 25/Jun/07 09:35 AM
New patch,
  • without changes to the docbook documents
  • with license headers
  • without system.out
  • without functionality (I have to look into this resource:// URL problem)

Lars Trieloff added a comment - 25/Jun/07 01:50 PM
Finally, I got it working. There have been some changes however:

1. The URL pattern is now resource://groupId/artifactId/pathInJarFile
2. I am using an older version of the docbook stylesheets, as the newest version is incompatible with Xalan http://www.mail-archive.com/docbook@lists.oasis-open.org/msg04014.html


Carlos Sanchez added a comment - 25/Jun/07 01:51 PM
Patch has been commited, now if I run docbook:transform in the pluign I get this exception

Make sure you use the artifacts in the central repo and not the ones in your repo

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'docbook'.
WAGON_VERSION: 1.0-beta-2
[INFO] ----------------------------------------------------------------------------
[INFO] Building Maven Docbook plugin
[INFO] task-segment: [docbook:transform]
[INFO] ----------------------------------------------------------------------------
Downloading: http://snapshots.repository.codehaus.org/org/codehaus/mojo/docbook-maven-plugin/1.0.0-alpha-2-SNAPSHOT/docbook-maven-plugin-1.0.0-alpha-2-20070625.184903-5.pom
4K downloaded
[INFO] [docbook:transform]
[INFO] Loading olink database generation stylesheet
Cannot find CatalogManager.properties
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Unable to get a transformer instance from source resource://net/xhtml/docbook.xsl
unknown protocol: resource
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.RuntimeException: Unable to get a transformer instance from source resource://net/xhtml/docbook.xsl
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:170)
at org.codehaus.mojo.docbook.OLinkDBUpdater.update(OLinkDBUpdater.java:108)
at org.codehaus.mojo.docbook.TransformMojo.execute(TransformMojo.java:256)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
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:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
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:585)
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)
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:683)
at org.codehaus.mojo.docbook.OLinkDBUpdater.updateOLinkDatabase(OLinkDBUpdater.java:166)
... 20 more
Caused by: javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:825)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:666)
... 21 more
Caused by: javax.xml.transform.TransformerException: java.net.MalformedURLException: unknown protocol: resource
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:819)
... 22 more
Caused by: java.net.MalformedURLException: unknown protocol: resource
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:795)
... 22 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Mon Jun 25 11:49:35 PDT 2007
[INFO] Final Memory: 3M/6M
[INFO] ------------------------------------------------------------------------


Lars Trieloff added a comment - 25/Jun/07 02:03 PM
Does your configuration contain references to resource://net/xhtml/docbook.xsl ? I am using only resources from the public maven repository. The correct docbook dependency is:

<dependency>
<groupId>docbook</groupId>
<artifactId>docbook-xsl</artifactId>
<version>1.67.2</version>
<type>zip</type>
<scope>runtime</scope>
</dependency>


Lars Trieloff added a comment - 25/Jun/07 02:06 PM
It does not look like you applied the correct patch, as my latest patch contains following lines:

@parameter expression="${stylesheetLocation}"

  • default-value="resource://docbook/docbook-xsl/docbook-xsl-1.67.2/"

while the current svn code contains

resource://net

which is incorrect


Carlos Sanchez added a comment - 25/Jun/07 02:08 PM
I'm running it in the plugin folder, with the latest in SVN, you can see the configuration there

The dependency used is dockbook packed as jar as you suggested

<dependency>
<groupId>org.docbook</groupId>
<artifactId>docbook-xsl</artifactId>
<version>1.72.0</version>
<scope>runtime</scope>
</dependency>


Lars Trieloff added a comment - 25/Jun/07 03:00 PM
Please use the older docbook dependency (packaged as a ZIP file, the updated plugin can handle this) as the newer docbook stylesheets come with MOJO-775.

And I still think you did not apply the right patch, as TransformMojo.java still contains the wrong default configuration.


Carlos Sanchez added a comment - 25/Jun/07 05:07 PM
I had the previous patch ready, now applied the differences in the last one, I think this is ready now
Please open new issues for anything else

Lars Trieloff added a comment - 25/Jun/07 05:13 PM
Thank you. Expect no updates earlier than tomorrow.