Maven 程序集-子文件夹 [英] maven assembly- sub folder

查看:71
本文介绍了Maven 程序集-子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用maven程序集插件组装

I want to use maven assembly plugin assembly

     '<plugin>
            <artifactId>maven-assembly-plugin</artifactId>
            <executions>
                <execution>
                    <id>dist</id>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                    <configuration>
                        <descriptors>
                            <descriptor>src/main/dist.xml</descriptor>
                        </descriptors>
                    </configuration>
                </execution>
            </executions>
        </plugin>'

我的描述符文件是:

<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>dist</id>
 <formats>
 <format>dir</format>
  </formats>
<files>
<file>
   <source>pom.xml</source>
   <outputDirectory>/ET</outputDirectory>
</file>

</files>

 </assembly>

结果是文件夹层次结构是:ET-> MyProject-MySnapshot-dist -> pom.xml

the result is folder hierarchy is: ET-> MyProject-MySnapshot-dist -> pom.xml

我希望结果是:ET->pom.xml

I want the result to be : ET->pom.xml

我该如何配置?

推荐答案

添加

 <includeBaseDirectory>false</includeBaseDirectory>

到你的程序集描述符.

这篇关于Maven 程序集-子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆