简体   繁体   中英

Files specified in include tag in build.xml are not getting added to the jar

I want to include config.properties file and all the json files present in resources folder in my jar. But none of the file is getting added to the jar. If I use only one include tag then those files are getting added to the jar. Please help me add all jsonm and config.properties file to the 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>

Try this:

<copy todir="${output.dir}/configuration">
    <fileset dir="configuration" includes="*/.json"/>
    <fileset dir="configuration" includes="**/config.properties"/> 
</copy>

Refer this link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM