简体   繁体   中英

How to setup Github and Netbeans to add libraries?

What I want is:

When someone pushes to a Github repository the Netbeans project would include the Libraries of my project, so that the people who will work in the project wouldn't have to download the libraries form anywhere else, how could I do that?

I also would like to know if when adding a global library to my project it grabs a copy of the library or it's just a reference?

Is there any other approach that I'm not considering? I know about Gradle and Maven, but I just don't want to use them right now.

Well, the only way you would do this would be to include a 'lib' folder in your project, and include added files in your commits. When you're configuring your project in Netbeans, you can specify which folders to put on the classpath. Add your lib folder to the classpath and place your libraries and other dependencies in there. Keep in mind, though, that it's generally not recommended to use git to track binary files. Binary files are usually fairly large, especially if you're checking in all the libraries and resources needed to build your application, and it will make cloning your repository painfully slow.

I would, however, strongly recommend that you consider using a proper build tool like Gradle or Maven. I know you said you don't want to, but unless there is a particularly compelling reason not to, you're only making things significantly harder for yourself. Maven will handle your dependencies, as well as running your unit tests and packaging your code for you. It will save you a lot of time and effort.

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