maven assembly- sub folder

☆樱花仙子☆ 提交于 2021-02-19 05:32:58

问题


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>'

my descriptor file is :

<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>

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

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

how can i configure it ?


回答1:


Add

 <includeBaseDirectory>false</includeBaseDirectory>

to your assembly descriptor.



来源:https://stackoverflow.com/questions/16338143/maven-assembly-sub-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!