1

我希望能够将文件夹 '${project.basedir}/src/main/resources/docker' 中的文件压缩到文件夹 target/docker-files/docker-files.zip 但目前它们正在保存在 'target/project -artifactId-1.0-SNAPSHOT.zip'

我编写了以下 zip.xml 文件

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>docker_files</id>
<formats>
  <format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
  <fileSet>
    <directory>${project.basedir}/src/main/resources/docker</directory>
    <filtered>true</filtered>
    <outputDirectory>/docker-files-zip</outputDirectory>
  </fileSet>
</fileSets>
</assembly>

我的 pom.xml 有以下插件:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <executions>
      <execution>
        <id>make-assembly</id>
        <phase>package</phase>
        <goals>
          <goal>single</goal>
        </goals>
        <configuration>
          <fileName>docker-files</fileName>
          <appendAssemblyId>false</appendAssemblyId>
          <descriptors>
            <descriptor>src/assembly/zip.xml</descriptor>
          </descriptors>
        </configuration>
      </execution>
    </executions>
  </plugin>

任何线索都会非常有帮助。

4

0 回答 0