1

我正在使用docbkx-tools通过使用 Maven 创建 DocBook。目前我可以制作各种格式的书。我还通过 WebDav 使用 Wagon 将我的 Maven 站点部署到 Web 服务器。

我想通过使用类似mvn clean install site:deploy. 你能帮忙解释一下吗?

4

2 回答 2

2

您只需将生成的 pdf/rtf/html 复制到正确的位置,它将与 maven-site 一起部署,或者您可以直接生成到站点的目标位置,如下所示:

 <plugin>
    <groupId>com.agilejava.docbkx</groupId>
    <artifactId>docbkx-maven-plugin</artifactId>
    <version>2.0.14</version>
    <dependencies>
      <dependency>
        <groupId>docbook</groupId>
        <artifactId>docbook-xml</artifactId>
        <version>4.4</version>
      </dependency>
    </dependencies>
    <executions>
      <execution>
        <goals>
          <goal>generate-pdf</goal>
        </goals>
        <phase>pre-site</phase>
        <configuration>
          <sourceDirectory>${basedir}/src/docbkx</sourceDirectory>
          <xincludeSupported>true</xincludeSupported>
          <includes>maui.xml</includes>
          <foCustomization>src/docbkx/fopdf.xsl</foCustomization>
          <targetDirectory>${project.build.directory}/site/</targetDirectory>
        </configuration>
      </execution>
    </executions>
  </plugin>

您不应该使用 site:deploy 您应该使用mvn sitemvn site-deploy来运行站点生命周期

于 2013-03-22T08:38:22.963 回答
2

您可以使用此属性控制 docbook 输出目录:(<targetDirectory>默认为${basedir}/target/docbkx/<something dependending on the output format>.

另一方面,maven-site-plugin它将获取创建到站点下的所有文件<inputDirectory>(全局,它与目录中的所有内容制作一个 zip)。默认为project.reporting.outputDirectory

因此,如果您将 docbook 插件更改为<targetDirectory>以下maven-site-plugin <inputDirectory>内容: docbook 输出将包含在生成的站点 zip 中。

Additionally, to be sure that your docbook plugin will be run before the site get deployed, you need to bind the docbook plugin the some phase in the site lifecycle before the site-deploy. So one of those phase is OK : pre-site site post-site Here is more details about binding a plugin to a phase

于 2013-03-22T08:48:07.357 回答