【发布时间】:2019-06-18 20:36:36
【问题描述】:
我想在我的 jar 中包含 config.properties 文件和资源文件夹中存在的所有 json 文件。但是没有一个文件被添加到 jar 中。如果我只使用一个包含标签,那么这些文件就会被添加到 jar 中。请帮我将所有 jsonm 和 config.properties 文件添加到 jar 中。
<!-- Export configuration files to build directory -->
<copy todir="${output.dir}/configuration">
<fileset dir="configuration">
<include name="**/config.properties"/>
<include name="**/*.json"/>
</fileset>
</copy>
<!-- Put exported configuration files on classpath -->
<fileset id="extra.jar.files" dir="${output.dir}/configuration">
<filename name="**/config.properties"/>
<filename name="**/*.json" />
</fileset>
【问题讨论】:
-
试试
-
这行得通!谢谢@TechFree