Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让maven程序集忽略归档中的所有目录?_Maven_Archive_Maven Assembly Plugin - Fatal编程技术网

如何让maven程序集忽略归档中的所有目录?

如何让maven程序集忽略归档中的所有目录?,maven,archive,maven-assembly-plugin,Maven,Archive,Maven Assembly Plugin,我追求的结果:我想要一个没有任何目录的zip文件。只有文件 我的插件条目: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <configuration>

我追求的结果:我想要一个没有任何目录的zip文件。只有文件

我的插件条目:

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-assembly-plugin</artifactId>
            <configuration>
                <descriptor>src/assembly/descriptor.xml</descriptor>
                <appendAssemblyId>false</appendAssemblyId>
                <finalName>${artifactId}-${pom.version}</finalName>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>single</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

可能与?这看起来是可行的,但我不知道之后它是如何进入maven回购协议的。其他项目依赖于此zip。也许我能找到一种方法将“扁平化”传递到压缩过程?
    <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.0.0 http://maven.apache.org/xsd/assembly-2.0.0.xsd
http://maven.apache.org/ASSEMBLY/2.0.0
http://maven.apache.org/ASSEMBLY/2.0.0 ">
  <id>distribution</id>
  <formats>
    <format>zip</format>
  </formats>

  <!--<baseDirectory>target</baseDirectory>-->
  <!--<includeBaseDirectory>true</includeBaseDirectory>-->
  <includeBaseDirectory>false</includeBaseDirectory>


  <fileSets>
    <fileSet>
    <outputDirectory>./</outputDirectory>
      <includes>
        <include>src/**/*</include>
      </includes>
      <excludes>
        <exclude>**/assembly/**</exclude>
        <exclude>**/*.iml</exclude>
      </excludes>
    </fileSet>
  </fileSets>
</assembly>
user@host /cygdrive/c/Ws/someproject : zv subproject/target/somezip-SNAPSHOT.zip
Archive:  subproject/target/somezip-SNAPSHOT.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  01-11-2018 09:03   src/
        0  01-05-2018 09:01   src/main/
        0  01-09-2018 11:34   src/main/resources/
     1158  01-09-2018 11:34   src/main/resources/SomeFile_0_0_0.xml
     1836  01-09-2018 11:34   src/main/resources/AnotherFile_0_0_0.xml
    11636  01-09-2018 11:34   src/main/resources/SomeFile1_0_0_0.xml
     1171  01-09-2018 11:34   src/main/resources/SomeFile1_0_0_1.xml
     1398  01-09-2018 11:34   src/main/resources/SomeFile1_0_0_1.xml
     1006  01-09-2018 11:34   src/main/resources/SomeFile1_0_1_0.xml
     6691  01-09-2018 11:34   src/main/resources/SomeFile1_1_0_0.xml
     1641  01-09-2018 11:34   src/main/resources/SomeFile1_1_0_1.xml
     1937  01-09-2018 11:34   src/main/resources/SomeFile1_1_0_0.xml
     3181  01-09-2018 11:34   src/main/resources/SomeFile3_0_0_0.xml
     1774  01-09-2018 11:34   src/main/resources/SomeFile3_1_0_0.xml
     1185  01-09-2018 11:34   src/main/resources/SomeFile3_1_0_0.xml
    14609  01-09-2018 11:34   src/main/resources/SomeFile3_3_0_0.xml
    35711  01-09-2018 11:34   src/main/resources/SomeFile4_0_0_0.xml
    15805  01-09-2018 11:34   src/main/resources/SomeFile5_0_0_0.xml
     3491  01-09-2018 11:34   src/main/resources/SomeFile5_1_0_0.xml
    18757  01-09-2018 11:34   src/main/resources/SomeFile_0_0_0.xml
     1571  01-09-2018 11:34   src/main/resources/SomeFile_0_1_0.xml
     1063  01-09-2018 11:34   src/main/resources/SomeFile_0_1_1.xml
     1631  01-09-2018 11:34   src/main/resources/Wiggity.txt
---------                     -------
   140357                     13 files