[英]Include parents documentation into zip-file
I have a multimodule maven project and I want to create an ZIP-File in the end which contains an .ear
and the documentation. 我有一个多模块Maven项目,我想最后创建一个ZIP文件,其中包含一个
.ear
和文档。
The documentation is made with docbkx and is part of the parent. 该文档是使用docbkx制作的 ,是父文档的一部分。 The
.ear
file is made in a module. .ear
文件在模块中创建。
My structure: 我的结构:
partent
|-src/docbkx
|-moduleEJB
|-moduleEAR
Where I am now? 我现在在哪里?
mvn clean package
) mvn clean package
) mvn clean site
) mvn clean site
) I want now to include the generated PDF of my documentation into my ZIP-file. 我现在想将生成的文档的PDF文件包含到我的ZIP文件中。 How can I achieve that?
我该如何实现? I tried to include the target directory of my parent project but nothing happened - which seems logical because when I run
mvn clean package
the documentation PDF isn't made as it's part of the pre-site
lifecycle. 我试图包括父项目的目标目录,但没有发生任何事情-这似乎是合乎逻辑的,因为当我运行
mvn clean package
,由于pre-site
生命周期的一部分,未创建文档PDF。
This is my assembly.xml
这是我的
assembly.xml
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>bin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}</directory>
<includes>
<include>*.ear</include>
</includes>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${parent.project.build.directory}/docbkx/pdf</directory>
<includes>
<include>*.pdf</include>
</includes>
<outputDirectory>docs/</outputDirectory>
</fileSet>
</fileSets>
</assembly>
This is the part of docbooks execution of my parent.pom: 这是我的parent.pom执行docbook的一部分:
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>generate-pdf</goal>
</goals>
<configuration>
</configuration>
</execution>
</executions>
Thanks in advance 提前致谢
edit: I also tried to change the phase of docbkx to compile but still nothing in my final zip. 编辑:我也试图更改docbkx的阶段以进行编译,但最终的zip文件中仍然没有任何内容。
I got it myself. 我自己弄的 As the parent project is the last to build I created a new project named documentation to create the PDF.
由于父项目是最后一个要构建的项目,因此我创建了一个名为documentation的新项目来创建PDF。 I then added this to the zip using a fileset
然后我使用文件集将此添加到zip中
<fileSet>
<directory>${project.build.directory}/../../documentation/target/docbkx/pdf</directory>
<includes>
<include>*.pdf</include>
</includes>
<outputDirectory>docs/</outputDirectory>
</fileSet>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.