简体   繁体   中英

How do I add shareable libraries in Netbeans?

In NetBeans (currrently using 7.3), there's a nice feature to add libraries using the Ant Library Manager. I'm able to add the jar file of the class files, jar file for the source files, and a zipped file of Javadoc files. It works very nicely on my workstation.

The problem is that these Ant Libraries don't seem to be distributable. How can I get these same libraries onto my laptop without painstakingly reviewing each library to see what is in it, download the jar/zip files, and re-define the library on my laptop (or anyone else working on the same project)? A couple features of the library I want to retain is that I can include the Javadocs for quick API documentation and source code for debugging.

I'd like to put these Ant Libraries in Subversion Git so that someone else who wants to work with the project can also download all the other library dependencies without having to build identical libraries. For example, I create a U2JPA library that has a specific version of U2JPA, a nightly build of OpenJPA, and a few other jars.

Unfortunately, Maven isn't an option in my current project because the vendor is not willing to commit the binaries to the Central Repository.

You can use a dedicated folder for libaries in Netbeans. Go to project properties and then to libraries and select a folder ->

Netbeans屏幕截图

When you do this all the current libraries will be automatically copied. As long as you make sure that the paths you set are relative rather than absolute you can just copy the folder along with your project. Take a llok at this .

The alternative is to create your own Nexus Server , put your files on there and use Maven. This is a much more robust solution but also significantly more complicated.

Maven (eventually Ivy) should be the option. If you don't want to put your library in the central repository use a repository manager : http://maven.apache.org/repository-management.html

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