简体   繁体   English

docbkx-maven-plugin:插件运行期间没有 output

[英]docbkx-maven-plugin: No output during run of plugin

I set up the docbkx-maven-plugin to generate PDF documentation for a source project.我设置了 docbkx-maven-plugin 来为源项目生成 PDF 文档。 In the parent pom I specified the version to be used as well as the reference to the docbook version to use:在父 pom 中,我指定了要使用的版本以及对要使用的 docbook 版本的引用:

<build>
<pluginManagement>
    <plugins>
        <plugin>
            <groupId>com.agilejava.docbkx</groupId>
            <artifactId>docbkx-maven-plugin</artifactId>
            <version>2.0.14</version>
            <dependencies>
                <dependency>
                    <groupId>net.sf.docbook</groupId>
                    <artifactId>docbook-xml</artifactId>
                    <version>5.0-all</version>
                    <type>zip</type>
                    <classifier>resources</classifier>
                    <scope>runtime</scope>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
</pluginManagement>

In the actual project I use the configuration:在实际项目中我使用的配置:

<build>
<plugins>
<plugin>
    <groupId>com.agilejava.docbkx</groupId>
    <artifactId>docbkx-maven-plugin</artifactId>
    <executions>
        <execution> 
            <id>usersmanual</id>
            <phase>generate-resources</phase>
            <goals>
                <goal>generate-pdf</goal>
            </goals>
            <configuration>
                <includes>${basedir}/UserManual/*.xml</includes>
                <includes>${basedir}/UserManual/src/*.xml</includes>
                                <targetDirectory>${project.build.directory}/UserManual</targetDirectory>
                <chunkedOutput>true</chunkedOutput>
            </configuration>
        </execution>
    </executions>
</plugin>
</plugins>
</build>

No matter what goal(s) I specify or what includes I provide, the plugin performs no(.) operation.无论我指定什么目标或提供什么内容,插件都执行 no(.) 操作。 There is no target directory created and I do not see any meaningful output on the command line: The result looks like:没有创建目标目录,我在命令行上看不到任何有意义的 output:结果如下所示:

[INFO] --- docbkx-maven-plugin:2.0.14:generate-pdf (usersmanual) @ documentation ---
[INFO]

I use Maven 3.0.3.我使用 Maven 3.0.3。

What do I miss here?我在这里想念什么? Is there any configuration not provided, yet, which will start the plugin to do some work?是否有任何未提供的配置,将启动插件做一些工作?

UPDATE: This is what I have now:更新:这就是我现在拥有的:

<plugin>
    <groupId>com.agilejava.docbkx</groupId>
    <artifactId>docbkx-maven-plugin</artifactId>
    <version>2.0.14</version>
    <dependencies>
        <dependency>
            <groupId>net.sf.docbook</groupId>
            <artifactId>docbook-xml</artifactId>
            <version>5.0-all</version>
            <type>zip</type>
            <classifier>resources</classifier>
        </dependency>
    </dependencies>
    <executions>
        <execution>
            <goals>
                <goal>generate-pdf</goal>
            </goals>
            <phase>prepare-package</phase>
            <configuration>
                <sourceDirectory>${project.basedir}/UserManual</sourceDirectory>
                <xincludeSupported>true</xincludeSupported>
                <includes>${project.basedir}/UserManual/UserManual.xml</includes>
                <includes>${project.basedir}/UserManual/**/*.xml</includes>
                <targetDirectory>${project.build.directory}/UserManual</targetDirectory>
            </configuration>
        </execution>
    </executions>
</plugin>

At least the directory target/Usermanual is greated, but it is still empty.至少目录 target/Usermanual 变大了,但它仍然是空的。 Why is there still not output?为什么还是没有output? Do I have a chance to get a meaningful log file from docbkx?我有机会从 docbkx 获得有意义的日志文件吗? mvn... -X does not tell much. mvn... -X 并没有说明什么。

Your latest example contains two includes configuration options which is not valid maven configuration.您的最新示例包含两个 include 配置选项,这些选项无效 maven 配置。

My recommendation is to stop trying to override all these defaults and accept the default location for the docbook source xml, at least initially while you get comfortable with the plugin and can diagnose what issues are from what changes.我的建议是停止尝试覆盖所有这些默认设置并接受 docbook 源 xml 的默认位置,至少在开始时您对插件感到满意并且可以诊断哪些问题来自哪些更改。

Anyway, your <includes> should be just the root xml file of the documentation you're trying to generate as it exists in the <sourceDirectory> .无论如何,您的<includes>应该只是您尝试生成的文档的根 xml 文件,因为它存在于<sourceDirectory>中。 You do not need to include all of the xml files, you instead need to follow the xincludes approach since you're declaring its usage.您不需要包含所有xml 文件,而是需要遵循 xincludes 方法,因为您要声明它的用法。 There are a number of projects using this mechanism that you can review and copy the usage of.有许多使用此机制的项目,您可以查看和复制其用法。

Ours is: https://github.com/jetty-project/jetty-documentation我们的是: https://github.com/jetty-project/jetty-documentation

We have a bit more complex usage since we use the maven filtering plugin to avoid having to mess with entities and the like.我们有一些更复杂的用法,因为我们使用 maven 过滤插件来避免混淆实体等。 Getting back to your includes usage, if your top level docbook file is index.xml then your includes would simply be:回到您的包含用法,如果您的顶级文档文件是 index.xml 那么您的包含将只是:

<includes>index.xml</includes>

No expressions or globs needed, you bring in the other xml documents with the <xi:include> tags where needed.不需要表达式或 glob,您可以在需要时使用<xi:include>标签引入其他 xml 文档。

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

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