Looking at Google gson 2.8.5 , I see several jars are distributed here https://repo1.maven.org/maven2/com/google/code/gson/gson/2.8.5/
By reading other posts, I understand that sources.jar contains source code, but jar contains the compiled class files.
The javadoc. jar contains a static html site which content is extracted from all the javadocs which are present in the Java source files.
That sources jar is a jar that contains only the source code (the . java files) corresponding to the compiled artifact. It is useful to add it as a source attachment in your IDE, to publish the sources, etc. As it only contains sources, not compiled classes (. class files), it is of no use as a library dependency.
jamdoc.jar To view an HTML documentation file, open your web browser and specify the file name of the javadoc you want to view, taken from the classdocs directory. Any of the following files are good for getting started: classdocs/AllNames. html.
The “maven-javadoc” plugin uses “ JDK\bin\javadoc.exe ” command to generate javadocs, pack in jar file and deploy along with your project.
Does this mean that, given the sources.jar, I can generate the jar myself?
Yes, you could extract the Java code from the sources.jar using the jar
command.
E.g.
jar xf gson-2.8.5-sources.jar
And than compiling the Java files using javac
.
But you need to have all the referenced dependencies in your classpath which are required when you call javac. These dependencies can be found in the project pom.xml
What is the general relationship between these three jars?
The .jar file contains the compliled code which is contained in the sources.jar. So using the sources.jar you could create the .jar yourself (as mentioned having the required dependencies). The javadoc.jar contains a static html site which content is extracted from all the javadocs which are present in the Java source files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With