使用 Maven 从 AsciiDoc 生成 PDF 并将其放在不同的模块中
Generating PDF from AsciiDoc using Maven and place it in a different module
我正在使用 Maven,我的项目中有多个模块。我项目的一个模块是 "documentation"。我在那里制作了一些 AsciiDoc,并在 "documentation" 模块的 pom 文件中放置了一些内容来构建我的 AsciiDoc 的 PDF 和 HTML(我正在使用 AsciiDoctor)。例如,对于我使用的 PDF 输出文件:
<outputFile>${project.build.directory}\generated-docs\MyDocument.pdf</outputFile>
这工作正常。现在我想把这个 PDF 放到另一个模块 "distribution" 中,它也是我项目的一个模块,并且与 "documentation" 处于同一级别。我正在考虑在我的 "distribution" 中添加一些依赖项到我的 "documentation" 模块,以便能够将 PDF 放入 "distribution" 的子文件夹 "documents" 中。但是,我不知道如何做到这一点,因为我不知道如何从 "distribution" 的 pom 中的不同模块访问某些内容。或者有 another/better 的方法吗?
如有任何帮助,我们将不胜感激。
我最终通过使用文件 "translate.xml" 实现了我的目标,该文件指定生成的 pdf 并将文件集中的分发文件夹指定为输出。然后在我的 pom 中,我使用 maven-assembly-plugin 获取这个 translate.xml 文件并将我的 pdf 放在分发文件夹中的 zip 中。
我正在使用 Maven,我的项目中有多个模块。我项目的一个模块是 "documentation"。我在那里制作了一些 AsciiDoc,并在 "documentation" 模块的 pom 文件中放置了一些内容来构建我的 AsciiDoc 的 PDF 和 HTML(我正在使用 AsciiDoctor)。例如,对于我使用的 PDF 输出文件:
<outputFile>${project.build.directory}\generated-docs\MyDocument.pdf</outputFile>
这工作正常。现在我想把这个 PDF 放到另一个模块 "distribution" 中,它也是我项目的一个模块,并且与 "documentation" 处于同一级别。我正在考虑在我的 "distribution" 中添加一些依赖项到我的 "documentation" 模块,以便能够将 PDF 放入 "distribution" 的子文件夹 "documents" 中。但是,我不知道如何做到这一点,因为我不知道如何从 "distribution" 的 pom 中的不同模块访问某些内容。或者有 another/better 的方法吗?
如有任何帮助,我们将不胜感激。
我最终通过使用文件 "translate.xml" 实现了我的目标,该文件指定生成的 pdf 并将文件集中的分发文件夹指定为输出。然后在我的 pom 中,我使用 maven-assembly-plugin 获取这个 translate.xml 文件并将我的 pdf 放在分发文件夹中的 zip 中。