maven assembly- 子文件夹

标签 maven maven-assembly-plugin

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

到您的程序集描述符。

关于maven assembly- 子文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16338143/

相关文章:

java - 如何将 Cobertura 与 Cucumber jvm 和 Maven 一起使用?

java - 使用 Maven 在 IntelliJ 中构建时解决 PermGen 错误?

java - 无法销毁线程组 org.codehaus.mojo.exec.ExecJavaMojo$IsolatedThreadGroup[name=SitemapCheck.SitemapAction,maxpri=10]

java - 贾斯珀异常 : Absolute uri cannot be resolved

java - 如何让 Maven 多模块程序集将 war 文件与 jar 文件放在单独的子目录中?

java - 多模块项目的 Maven 组装插件入门

java - 在这种情况下 maven-assemble-plugin 是否有效

maven-2 - Maven-资源过滤: implications of the @ symbol in resource files

java - 将 java 命令转换为 Maven 配置文件时出现问题

java - jsonschema2pojo maven插件不生成Java类