Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: docbook
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :6
Description
Attachments
-
- maven-docbook-profile.patch
- 25/Jun/07 1:50 PM
- 58 kB
- Lars Trieloff
-
- maven-docbook-profile.patch
- 25/Jun/07 9:35 AM
- 51 kB
- Lars Trieloff
-
- maven-docbook-profiling.patch
- 08/Jun/07 1:48 AM
- 111 kB
- Lars Trieloff
-
- maven-docbook-profiling.patch
- 07/Jun/07 3:42 PM
- 52 kB
- Lars Trieloff
-
- maven-docbook-profiling.patch
- 15/Mar/07 8:32 AM
- 52 kB
- Lars Trieloff
-
- MOJO-693.txt
- 01/May/07 5:33 PM
- 155 kB
- Carlos Sanchez
Issue Links
Activity
for some reason the xml files show up as completely changed in the patch although only the first line changes
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] ------------------------------------------------------------------------
It looks like the incorrect URL resolver is used. I will take a look at your changes later.
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.
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.
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:
- use a complete fop pom (from http://releases.mindquarry.org/org/apache/xmlgraphics/fop/0.93/)
- use Docbook-XSL-Stylesheets packaged as JAR (from http://releases.mindquarry.org/org/docbook/docbook-xsl/1.72.0/)
- add releases.mindquarry.org as repository (this is only a temporary solution, it would be best to move the artifacts to the central repository)
- use Xalan instead of Saxon, as problems occur when Saxon tries to use extension functions in the DocBook stylesheets
otherwise it is pretty much everything that Carlos changed.
- use a complete fop pom (from http://releases.mindquarry.org/org/apache/xmlgraphics/fop/0.93/)
- use Docbook-XSL-Stylesheets packaged as JAR (from http://releases.mindquarry.org/org/docbook/docbook-xsl/1.72.0/)
- add releases.mindquarry.org as repository (this is only a temporary solution, it would be best to move the artifacts to the central repository)
- use Xalan instead of Saxon, as problems occur when Saxon tries to use extension functions in the DocBook stylesheets otherwise it is pretty much everything that Carlos changed.
- 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
- 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
- Let's look wether
MOJO-775still occurs with the new patch - without fop, it is mainly org.docbook.docbook-xsl.jar
- I updated the patch today to apply against trunk. (http://jira.codehaus.org/secure/attachment/27852/maven-docbook-profiling.patch)
- Let's look wether
MOJO-775still occurs with the new patch - without fop, it is mainly org.docbook.docbook-xsl.jar
- I updated the patch today to apply against trunk. (http://jira.codehaus.org/secure/attachment/27852/maven-docbook-profiling.patch)
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
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.
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
- 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
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.
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)
- without changes to the docbook documents
- with license headers
- without system.out
- without functionality (I have to look into this resource:// URL problem)
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
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] ------------------------------------------------------------------------
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>
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
- default-value="resource://docbook/docbook-xsl/docbook-xsl-1.67.2/"
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>
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.
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
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