通过 maven 打包时如何压缩文件夹内容而不是文件夹

问题描述

这是我的程序集文件。

<id>assembly</id>
<baseDirectory>/</baseDirectory>
<formats>
    <format>zip</format>
</formats>
<fileSets>
    <fileSet>
        <directory>../../src</directory>
        <includes>
            <include>**/**/**</include>
        </includes>
        <outputDirectory>/</outputDirectory>
    </fileSet>
</fileSets>

这是我的 pom 文件的一些快照。

<plugin>    
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4</version>
<configuration>
    <finalName>artifactName</finalName>
    <appendAssemblyId>false</appendAssemblyId>
    <descriptors>
        <descriptor>assembly.xml</descriptor>
    </descriptors>
</configuration>
</plugin>.  

我的 src 目录中有 2 个文件夹,我想要在我的 artifactName.zip 中,虽然我确实得到了这些文件夹,但是当我解压缩时,我首先得到了 artifactName,其中进一步包含了 2 个文件夹。

我需要解压缩应该直接给我文件夹。所以基本上解压应该给我内容,即 2 个文件夹。

这是我生成 zip 的 mvn 命令。我正在使用 mac 机器来运行它。

mvn clean -B -e -f pom.xml -DpomFile=pom.xml -Dfile=/path/to/artifactName.zip -Dtypes=zip assembly:single

如果有人能帮助我,我将不胜感激!!谢谢!!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...