Keep NetBeans Nimble with Maven Remote Search
Read about a free NetBeans module that disables wasteful index downloads in favor of remote searches.
NetBeans IDE has very good Maven support. However, everyone using Maven in NetBeans IDE generally wastes gigabytes of precious SSD space plus a lot of bandwidth.
NetBeans IDE periodically downloads the Maven “index” in order to have a list of every Maven library in the world for POM code completions, wizards, and such. How large is this Maven index? Hundreds of megabytes!
On my work machine the mavenindex/central caches take up 1.3GB!
And while the Maven folks have gotten smart about incremental updates, this index archive still has to be downloaded and unarchived on disk. This is really no fun while you are on a trip and using your phone’s expensive data roaming or when your laptop only has a 128GB drive.
What to do?
The good news is that there is now a free NetBeans module for NetBeans IDE 8.2, which is to be released soon, that disables this wasteful index download in favor of remote search.
Instead of having a list of all the Maven libraries on the planet on your drive, the module will just query the Maven central repository for what you need. This uses no disk space and very little bandwidth for the Maven repository search. Of course, you need an internet connection for this to work, but since you are presumably trying to download some Maven artifact you most likely are online anyhow.
How to try this today?
Get NetBeans IDE 8.2 (or go to http://bits.netbeans.org/download/trunk/nightly/latest/ and download a NetBeans build if you are reading this early).
Go to https://bitbucket.org/emilianbold/maven.search.remote/downloads and download the last Maven Remote Search build.
Install the module via Tools | Plugins (How? See http://wiki.netbeans.org/FaqPluginInstall.)
After the install (and an IDE restart for good measure) the Maven remote index download will be disabled and all your Maven queries will become remote searches.
The plugin is very simple and could be improved in various ways. Feel free to give any feedback and look at the plugin source code on https://bitbucket.org/emilianbold/maven.search.remote
Many thanks to Tomas Stupka for adding the necessary hooks into the Maven modules for this plugin to work and to Geertjan Wielenga for getting me in touch with Tomas. All the bugs are mine, of course!