Java 生成的文件不会使用程序集插件复制到Maven project zip中
Java代码创建了一些文件,并在内部尝试复制到zip中。但除某些文件外,所有文件都已复制。我无法找出这背后的原因 我正在添加我试图使用其权限复制的文件夹的目录结构,以及它在目标文件夹(zip文件)中复制的内容 目录结构及其权限- XYZ-MacBook-Pro:etl_configs XYZ$ pwd FILE_PATH_LOCATION/etl_configs XYZ-MacBook-Pro:etl_configs XYZ$ ls -l * -rw-r--r-- 1 XYZ staff 980 Jun 26 01:02 etl-spec.json -rwxr-xr-x 1 XYZ staff 2037 Jun 15 19:04 etl-without-transformation.json feeds: total 16 -rw-r--r-- 1 XYZ staff 612 Jun 26 00:54 feed_1.json -rw-r--r-- 1 XYZ staff 616 Jun 26 01:02 feed_2.json tables: total 16 -rw-r--r-- 1 XYZ staff 878 Jun 26 00:54 table_1.json -rw-r--r-- 1 XYZ staff 880 Jun 26 01:02 table_2.jsonJava 生成的文件不会使用程序集插件复制到Maven project zip中,java,maven,maven-assembly-plugin,Java,Maven,Maven Assembly Plugin,Java代码创建了一些文件,并在内部尝试复制到zip中。但除某些文件外,所有文件都已复制。我无法找出这背后的原因 我正在添加我试图使用其权限复制的文件夹的目录结构,以及它在目标文件夹(zip文件)中复制的内容 目录结构及其权限- XYZ-MacBook-Pro:etl_configs XYZ$ pwd FILE_PATH_LOCATION/etl_configs XYZ-MacBook-Pro:etl_configs XYZ$ ls -l * -rw-r--r-- 1 XYZ staff
理想情况下,它应该将整个文件夹复制到zip中。但是它没有发生。这个问题与在程序集描述符中使用
的方式有关。您当前使用的
<fileSet>
<directory>${project.basedir}/etl_configs</directory>
<outputDirectory>/etl_configs</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
但是:
当
子元素存在时,它们定义一组要包含的文件和目录。如果不存在,则
表示所有有效值
因此,您可以:
<fileSet>
<directory>${project.basedir}/etl_configs</directory>
<outputDirectory>/etl_configs</outputDirectory>
</fileSet>
${project.basedir}/etl_配置
/etl_配置
XYZ-MacBook-Pro:etl-without-transformation-template-1.0-SNAPSHOT XYZ$ pwd
FILE_PATH_LOCATION/target/etl-without-transformation-template-1.0-SNAPSHOT-zip/etl-without-transformation-template-1.0-SNAPSHOT
XYZ-MacBook-Pro:etl-without-transformation-template-1.0-SNAPSHOT XYZ$ ls -l etl_configs/*
-rwxr-xr-x 1 XYZ staff 980 Jun 26 01:02 etl_configs/etl-spec.json
-rwxr-xr-x 1 XYZ staff 2037 Jun 15 19:04 etl_configs/etl-without-transformation.json
etl_configs/feeds:
etl_configs/tables:
<fileSet>
<directory>${project.basedir}/etl_configs</directory>
<outputDirectory>/etl_configs</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/etl_configs</directory>
<outputDirectory>/etl_configs</outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/etl_configs</directory>
<outputDirectory>/etl_configs</outputDirectory>
</fileSet>