[英]Maven: Package files generated during site lifecycle using Assembly plugin
I'm attempting to package some files that get generated during the site life-cycle
of a maven project so that I can automatically share these resources with other projects that use them. 我试图打包在Maven项目的
site life-cycle
中生成的一些文件,以便可以与使用它们的其他项目自动共享这些资源。
I have successfully used the maven assembly plugin to package files that already exist in the project(under /src/main/...
), however when I try to package files in the /target/site/
path into a zip it always ends up being empty. 我已经成功地使用了maven程序集插件来打包项目中已经存在的文件(在
/src/main/...
),但是当我尝试将/target/site/
路径中的文件打包为zip时,它总是结束空着。
The POM.xml
looks something like this POM.xml
看起来像这样
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>make shared resources</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<descriptors>
<descriptor>src/main/assembly/resources.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
The assembly descriptor 程序集描述符
<assembly>
<id>resources</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.build.directory}/site/</directory>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</assembly>
I have attempted changing the phase to <phase>post-site</phase>
but I have the feeling the plugin only executes on the default life-cycle. 我尝试将阶段更改为
<phase>post-site</phase>
但是我感到插件仅在默认生命周期内执行。
Is there any way to do this? 有什么办法吗?
我想到的重要一件事是:如果您有需要作为其他项目依赖项的文件,则必须在通常的生命周期内而不是在站点生命周期内生成它们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.