解决方法
这是我个人添加到我的ant文件(build.xml)中:
<target description="bundle sources in a jar" name="package-sources"> <jar basedir="src" destfile="dist/${ant.project.name}-sources.jar"/> </target> <target depends="-javadoc-build" description="bundle javadoc in a jar" name="package-doc"> <jar basedir="dist/javadoc" destfile="dist/${ant.project.name}-javadoc.jar"/> </target>
使用Netbeans手动调用这些目标,或者您可以使用挂钩目标:
<target name="-post-jar" depends="package-sources,package-doc" />