Netbeans: move a text file into dist folder when compiling

微笑、不失礼 提交于 2019-12-12 08:54:08

问题


I have a text file (let's say textfile.txt) stored in the project folder in Netbeans 7.3, e.g.

project folder
  textfile.txt
  src
    package
    package.subpackage
      MyClass.java

When I compile I get a dist folder where the jar file is put in, e.g.

project folder
  textfile.txt
  dist
    MyProject.jar
  src
    package
    package.subpackage
      MyClass.java

How can I edit the build.xml file to make the file textfile.txt being copied under dist folder?


回答1:


Edit the "-post-compile" target inside the build.xml as follows:

<target name="-post-compile">
    <copy file="textfile.txt" todir="${dist.dir}"/>        
</target>


来源:https://stackoverflow.com/questions/16356849/netbeans-move-a-text-file-into-dist-folder-when-compiling

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!