tags:

views:

431

answers:

1

Is there a way to automatically generate source and javadoc jars in Netbeans? Ideally I would like to place jars of my source and JavaDoc in the dist folder each time i build.

+1  A: 

Here is what I personnaly add to my ant files (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>

With Netbeans call these targets manually, or you can use hook targets :

<target -post-jar depends="package-sources, package-doc" />
Thanks, I think this is what I'm looking for. I'll try it out.
Chad Lowe
Thanks for answer. Do I just add the lines in build.xml. Because it didn't work for me. What does "With Netbeans call these targets manually, or you can use hook targets" mean?
hrzafer