0

I'm using netbeans 8.1. How can I add a Javadocs to a Project_Name.jar file without using the Edit Jar Reference?

I tried to use the build.xml file in my java project but I can only create a javadocs.jar and javadocs folder .

This is the code I tried thanks to user805575 code

<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="${test.src.dir}" jarfile="${dist.dir}/${application.title}-test.jar"/>
<jar compress="${jar.compress}" basedir="${dist.javadoc.dir}" jarfile="${dist.dir}/${application.title}-javadoc.jar"/>

This code allow me to create a javadoc.jar and source.jar, but what I want is to already add the javadocs and sources to the Project_Name.jar to avoid manually adding it when I clean and build

In the folder of nbproject there is a file name project.properties, i see a code excludes=file.reference.Project_Name-javadoc.jar = dist\\Project_Name-javadoc.jar which i manually add the javadocs using the Edit Jar Reference how can I code this in .xml file or .properties? So I can use my jar in any java project with Javadocs

1 Answers1

0

To create a new maven project in Netbeans go File->New Project You should see a this New Maven Project

This will create a new Maven project You can then use Maven to build your project. This will create your sources jar as well, which I assume you are refering to when you say javadocs.

If you plan to become a Java developer tools such as Maven are vital. It will be well worth your time reading up here https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html