maven - Maven:读取文件并循环内容
问题描述
所以我有 2 个文件,其中包含我想要打包的其他文件的列表。这就是目录的样子
/mydir
|-pom.xml
|-a.out
|-b.out
|-c.out
|-d.out
|-read1.list
|-read2.list
下面是 read1.list 和 read2.list 的内容
read1.list
a.out
b.out
read2.list
c.out
所以我想让 maven 读取 read1.list 和 read2.list 文件,获取文件列表,然后将它们复制到另一个目录。我想我已经阅读了文件部分,但我不知道在那之后该怎么做。
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0.0</version>
<executions>
<execution>
<id>read property file</id>
<phase>process-resources</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>${basedir}/read1.list</file>
<file>${basedir}/read2.list</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
我从这篇文章中得到了这段代码,但我不确定下一步该做什么。 Maven:读取属性文件并复制资源
任何帮助将不胜感激。
解决方案
推荐阅读
- spring-boot - 引起:java.security.cert.CertificateException:没有主题替代 DNS 名称匹配
- python - Django中的ImportError循环依赖
- java - 在 IBM MQ (Java) 中,如何最好使用 PCF 访问给定队列管理器下的所有队列?
- aws-lambda - 如何从 AWS Lambda 调用 Lambda 授权 API Gateway 端点
- android - 在我的 android 应用程序中滚动列表视图时,数据正在消失。我在片段中使用列表视图
- python - 压缩 netcdf 文件中的数组
- java - java - 如何在java中比较并获得预期结果的excel表?
- android - 在 Zebra RFID Android 中执行盘点时如何获取内存库用户数据?
- sql - Sql Server - Get database constraints of all tables ( default and check constraints)
- javascript - 我无法安装 Vue.use (2019) 的 vue-toasted