IT序号网

maven assembly- 子文件夹

emanlee 2025年05月04日 编程语言 242 0

我想使用maven 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>' 

我的描述 rune 件是:

<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

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

我该如何配置它?

请您参考如下方法:

添加

 <includeBaseDirectory>false</includeBaseDirectory> 

到您的程序集描述符。


评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!