Make jar source package

Manually make the jar source package

 

Originally, most open source jar packages have accompanying source code packages, but sometimes maven cannot be downloaded and cannot be found on the Internet, so the author will share a process of manually making source code packages here.

 

Here is an example of hadoop-common-2.8.0-sources.jar

First, get the source code, download it on github or the official website, find the org directory, and compare others by yourself.

hadoop-common-2.8.0-sources.jar content is as follows:

META-INF                : (directory) packaging is automatically generated

org : (directory)

MANIFEST.INF          : Obtained from the jar package corresponding to the source package, or in the file downloaded by github

LICENSE.txt : same as above

NOTICE.txt : same as above

 

Put the files marked in red in one directory.

Dos window switch to this directory, execute jar cvf hadoop-common-2.8.0-sources.jar .

Note: (dot represents the current directory, jdk needs to be installed first)

Then all the files in the current directory are compressed into the .jar file.

 

In the same way, several .class files can also be packaged into jar packages

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326833318&siteId=291194637