简体   繁体   English

docbkx-maven-plugin非常慢

[英]docbkx-maven-plugin very slow

I transferred an existing docbook project from ANT (using dopus framework) to the docbkx-maven-plugin. 我将现有的docbook项目从ANT(使用dopus框架)转移到docbkx-maven-plugin。 After some troubles I got the output right, but the performance is very slow. 经过一些麻烦后,我得到了正确的输出,但是性能却很慢。 The processing took with ANT 24sec. ANT 24sec完成了处理。 With the maven plugin it takes more than 6min. 使用maven插件需要花费6分钟以上的时间。

The processing seems to stop at: 处理似乎停止在:

[INFO] Processing input file: manual.xml
[DEBUG] Xerces XInclude mode entered
[DEBUG] User Customization provided: ...doc\src\main\custom-cfg\fo.xsl
[DEBUG] User Customization provided: ...doc\src\main\custom-cfg\fo.xsl
[DEBUG] User Customization provided: ...doc\src\main\custom-cfg\fo.xsl
[DEBUG] Configure the transformer.
[INFO] Applying customization parameters after docbkx parameters

After that there is no output for about 2-3min per goal(I have 2 goals, for JavaHelp and PDF). 之后,每个目标约2-3分钟没有输出(对于JavaHelp和PDF,我有2个目标)。 If i deactivate xincludeSupported, it runs very fast, but obviously the output is useless. 如果我停用xincludeSupported,它运行速度非常快,但是显然输出是无用的。

Any help to speed up the build process would be appreciated. 任何帮助加快构建过程的帮助将不胜感激。

Here is the config section in the pom file: 这是pom文件中的config部分:

    <configuration>
      <sourceDirectory>src/main/docbook</sourceDirectory>
      <foCustomization>src/main/custom-cfg/fo.xsl</foCustomization> 
      <includes>manual.xml</includes>
      <xincludeSupported>true</xincludeSupported>
      <chapterAutolabel>true</chapterAutolabel>
      <sectionAutolabel>true</sectionAutolabel> 
      <sectionAutolabelMaxDepth>5</sectionAutolabelMaxDepth>
      <sectionLabelIncludesComponentLabel>true</sectionLabelIncludesComponentLabel>

      <preProcess>
        <copy todir="${project.build.directory}/docbkx/javahelp/resource">
          <fileset dir="src/main/docbook/resource/"/>
        </copy>
      </preProcess>
    </configuration>

After some research I found the reason. 经过研究,我找到了原因。 In the xml files is the doctype defined: 在xml文件中定义了doctype:

<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
          "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
  [
    <!ENTITY % entities SYSTEM "../custom-cfg/local-entities.xml">
    %entities;
  ]
>

The build tried to download the dtd for each file, the network traffic caused the slow build. 该构建尝试为每个文件下载dtd,网络流量导致构建缓慢。 By adding 通过增加

            <dependency>
                <groupId>docbook</groupId>
                <artifactId>docbook-xml</artifactId>
                <version>4.5</version>
                <scope>runtime</scope>
            </dependency>

to my docbkx-maven-plugin dependencies I could solve the problem. 到我的docbkx-maven-plugin依赖项,我可以解决问题。 (This dependency is different for the different docbook versions, for this there is also a repository entry necessary as described in: http://docbkx-tools.sourceforge.net/docbkx-samples/manual.html#d5e28 ) (此依赖关系对于不同的docbook版本是不同的,为此,还需要一个存储库条目,如http://docbkx-tools.sourceforge.net/docbkx-samples/manual.html#d5e28中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM