gpt4 book ai didi

Maven PDF 不包含站点信息

转载 作者:行者123 更新时间:2023-12-02 02:00:46 24 4
gpt4 key购买 nike

使用:

  • Maven 3.2.3
  • Java 1.8

我使用以下方法生成了该网站:

mvn site

然后我想从这个生成的网站生成 PDF(根据 PDF Plugin Usage ,它使用网站文档)。我刚刚运行了命令:

mvn pdf:pdf

Maven 确实生成了一个 PDF,但它所做的只是显示项目名称、版本、“项目文档”和目录,但没有显示在任何地方。所有站点信息均丢失。

我是否需要在 POM 中包含某些内容或其他内容才能使其正常工作?我感谢您的帮助!

更新

根据下面的评论,我尝试使用 pdf.xml,这似乎让我更接近我正在寻找的输出。

pdf.xml 看起来像:

<document xmlns="http://maven.apache.org/DOCUMENT/1.0.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/DOCUMENT/1.0.1
http://maven.apache.org/xsd/document-1.0.1.xsd"
outputName="MyProject">

<meta>
<title>My Project</title>
<author>IT Department</author>
</meta>

<toc name="Table of Contents">
<item name="Introduction" ref="index.html"/>
<item name="Goals" ref="project-info.html"/>
<item name="Dependencies" ref="dependencies.html"/>
<item name="Dependency Tree" ref="dependency-tree.html"/>
<item name="Team" ref="team-list.html"/>
</toc>

<cover>
<coverTitle>${project.name}</coverTitle>
<coverSubTitle>v. ${project.version}</coverSubTitle>
<coverType>User Guide</coverType>
<projectName>${project.name}</projectName>
<projectLogo>http://somesite.com/logo.jpg</projectLogo>
<companyName>Google</companyName>
<companyLogo>http://google.com/logo.gif</companyLogo>
</cover>
</document>

我引用的 HTML 文件位于 /src/site 中。然后它们也被放入 /target/pdf/site.tmp 文件夹中。

Maven 给出以下输出,但存在问题:

[INFO] --- maven-pdf-plugin:1.3:pdf (pdf) @ myproject---
[WARNING] Bookmarks: Unresolved id reference "./project-info" found.
[WARNING] Bookmarks: Unresolved id reference "./dependencies" found.
[WARNING] Bookmarks: Unresolved id reference "./dependency-tree" found.
[WARNING] Bookmarks: Unresolved id reference "./team-list" found.
[WARNING] Bookmarks: Unresolved id reference "./index" found.
[WARNING] Page i: Unresolved id reference "./project-info" found.
[WARNING] Page i: Unresolved id reference "./dependencies" found.
[WARNING] Page i: Unresolved id reference "./dependency-tree" found.
[WARNING] Page i: Unresolved id reference "./team-list" found.
[WARNING] Page i: Unresolved id reference "./index" found.
[WARNING] Bookmark with IDRef "./index" has a null PageViewport.
[WARNING] Bookmark with IDRef "./project-info" has a null PageViewport.
[WARNING] Bookmark with IDRef "./dependencies" has a null PageViewport.
[WARNING] Bookmark with IDRef "./dependency-tree" has a null PageViewport.
[WARNING] Bookmark with IDRef "./team-list" has a null PageViewport.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.354 s
[INFO] Finished at: 2015-03-20T10:03:37-04:00
[INFO] Final Memory: 30M/318M
[INFO] ------------------------------------------------------------------------

无论我如何尝试,都无法解决未解析的 ID 引用问题。生成 PDF 并显示目录,但右侧没有数字,也没有显示其他页面。

最佳答案

嗨,我猜这个错误是由于 maven-pdf 插件默认不支持 markdown 造成的。我遇到了同样的问题,我可以通过在 pom.xml 中添加以下插件配置来修复它:

        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pdf-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>pdf</id>
<phase>site</phase>
<goals>
<goal>pdf</goal>
</goals>
<configuration>
<outputDirectory>${project.reporting.outputDirectory}</outputDirectory>
<includeReports>false</includeReports>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.6</version>
</dependency>
</dependencies>
</plugin>

关于Maven PDF 不包含站点信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28966387/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com