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.
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
Please try adding this to build.xml. I've tested it on NetBeans IDE 7.0
I tried the following on NetBeans IDE 7.2 and it works (assuming that the project name is MyProject)
go to the MyProject directory
open build.xml file in a text editor
add the following lines under the line
<import file="nbproject/build-impl.xml"/>
:<target name="-post-jar" description="bundle sources and javadoc in a jar" depends="javadoc"> <jar compress="${jar.compress}" basedir="${src.dir}" jarfile="${dist.dir}/${application.title}-sources.jar"/> <jar compress="${jar.compress}" basedir="${dist.javadoc.dir}" jarfile="${dist.dir}/${application.title}-javadoc.jar"/> </target>
go to nbproject folder and open the project.properties file in a text editor
edit the name of the output binary file (set to the project name.jar by default):
# This directory is removed when the project is cleaned: dist.dir=dist dist.jar=${dist.dir}/**MyProject-binaries**.jar
Hope it works with you too.
Here is what I personally add to my ant files (build.xml) :
With Netbeans call these targets manually, or you can use hook targets :