简体   繁体   中英

NetBeans Java - How to add external library (jar) to git repository

I am looking for a best practices workflow for doing this.

Currently what I know how to do is get my new repository and project created in netbeans, then I manually create a folder in my new project folder called libraries, copy my jar file to this folder, then add the library. If I add the library to my global libraries or import it from its own folder, git does not include the file in my commits. So do I need to just be doing this slightly manual process or is there some other workflow I should follow?

I found this solution which has some workflows that either involve symbolic links or git --work-tree=/ add /home/some/directory . Is there any built in netbeans solution?

So the answer to this is pretty simple. Just right click the Libraries folder under your project and add the library (likely through adding a jar file).

Then under your project properties, make sure Build=>Packaging has the Copy Dependent Libraries checkbox ticked.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM