在如下所示的maven程序集中,结果是重新包括基目录的递归。
以下失败实际上消耗了cpu并且没有返回:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>deploy</id>
<baseDirectory>hive</baseDirectory>
<includeBaseDirectory></includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${basedir}/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
<fileSet>
<directory>${basedir}</directory>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${basedir}/target/${project.build.finalName}.jar</source>
<outputDirectory>lib</outputDirectory>
</file>
</files>
</assembly>
如果不包含基本目录,则正确包含lib / *下的文件并且程序集成功。那么......这里的语法是什么?谢谢!
下面构建一个输出zip但没有基础目录中的文件 - 所以它不完整:
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>deploy</id>
<baseDirectory>hive</baseDirectory>
<includeBaseDirectory></includeBaseDirectory>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>${basedir}/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
</fileSets>
<files>
<file>
<source>${basedir}/target/${project.build.finalName}.jar</source>
<outputDirectory>lib</outputDirectory>
</file>
</files>
</assembly>
答案 0 :(得分:3)
以下是使用带有通配符的include
进行此操作的方法:
<fileSet>
<directory>${basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.rb</include>
<include>*.sh</include>
<include>*.properties</include>
</includes>
</fileSet>