How can I include a folder into the dist JAR as part of the build process using Netbeans?

后端 未结 2 750
夕颜
夕颜 2021-01-19 10:21

I\'m using Netbeans 6.9 , and I have looked into editing the build.xml file so that I can include directories and files in the jar file that results from building the projec

相关标签:
2条回答
  • 2021-01-19 11:05

    http://ant.apache.org/manual/Tasks/copydir.html

      <copydir src="${base.path}/lib/"
               dest="${build.path}/lib"
      />
    
      <copydir src="${base.path}/images/"
               dest="${build.path}/images"
      />
    
      <copydir src="${base.path}/src/com/"
               dest="${build.path}/com"
      />
      <copydir src="${base.path}/META-INF/"
               dest="${build.path}/META-INF"
      />
    

    http://ant.apache.org/manual/Tasks/jar.html

    <jar destfile="project.jar"
         basedir="${build.path}"
         includes="**/*.*"
         />
    
    0 讨论(0)
  • 2021-01-19 11:21

    In case someone see this, copydir is deprecated now, use:

    <target name="-post-compile">
        <copy todir="${dist.dir}/ace">
            <fileset dir="src/ace"/>
        </copy>
    </target>
    
    0 讨论(0)
提交回复
热议问题