Gradle in NetBeans IDE 7.1

I recently created a very simplistic Gradle plugin for NetBeans IDE 7.1:

This is how it works. Before getting started, make sure that you installation of NetBeans IDE supports Groovy.

Then, install the plugin, and you'll see this:

Then, after installing the plugin, before doing anything else, register your Gradle installation:

Next, go to the New File dialog and choose the "Gradle Desktop Build Script":

On the next page, make sure to name the script "build":

Click Finish in the dialog above and your new Gradle script will be created.

Switch to the Files window and you should now be able to expand the "build.gradle" file that you find there:

As you can see, you can right-click any of the Gradle tasks and run them. You can also double-click the file node to open the file in the Groovy editor:

The file above is exactly the content you'll get when choosing the "Gradle Desktop Build Script". When you make changes in the Gradle file, the node hierarchy will automatically be updated.

Make sure that you follow the steps above, in the order described above, before leaving comments about the plugin not working for you.


Thanks a lot, Netbeans needs this to stay competitive. Though I wish this plugin was open source and not just you.

Posted by guest on March 10, 2012 at 12:04 AM PST #

It IS open source. Do you want to contribute?

Posted by Geertjan on March 10, 2012 at 12:19 AM PST #

Sorta. I'm typically a Netbeans users, but I've been having problems working with the Gradle codebase, so I switched to Intellij, which has better gradle support. I'd like to use Netbeans if possible and could spend a little time helping. First problem is having .gradle files being renamed to build.gradle. Is there a git/hg repo for this plugin? Is the CI for building/releasing the plugin?

How far away is the plugin from supporting the blind importing of a build.gradle as a Project? Like how a maven project can be opened.

Posted by Justin Ryan on March 12, 2012 at 12:19 PM PDT #

NB 7.1 trying to expand build.gradle and IDE sits at Loading task...

Starting Gradle daemon
Starting daemon process: workingDir = C:\Documents and Settings\SGoldsmith\.gradle\daemon\1.0-milestone-9, daemonArgs: [C:\Program Files\Java\jdk1.6.0_31\bin\java.exe, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252, -cp, C:\projects\gradle-1.0-milestone-9\lib\gradle-launcher-1.0-milestone-9.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 1.0-milestone-9, C:\Documents and Settings\SGoldsmith\.gradle\daemon, 10800000, 7655365d-7928-45b1-bda1-8e6d4b945555, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.nodes.AsynchChildren
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.makeUninheritable(
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.initialize(
Caused: org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer$ProcessInitializationException: Failed to configure the standard stream handles to be 'uninheritable'.
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.initialize(
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(
Caused: org.gradle.api.GradleException: Could not start Gradle daemon.
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.createConnection(
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(
at org.gradle.launcher.daemon.client.DaemonClient.execute(
at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(
at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(
at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(
at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(
at org.gradle.tooling.internal.provider.DefaultConnection.getTheModel(
at org.gradle.tooling.internal.provider.DefaultConnection.getModel(
at org.gradle.tooling.internal.consumer.LazyConnection$
at org.gradle.tooling.internal.consumer.LazyConnection$
at org.gradle.tooling.internal.consumer.LazyConnection.withConnection(
at org.gradle.tooling.internal.consumer.LazyConnection.getModel(
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.getModel(
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$
Caused: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'BuildableProject' using Gradle installation 'C:\projects\gradle-1.0-milestone-9'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$
[catch] at

Posted by guest on March 16, 2012 at 06:39 AM PDT #


Posted by Geertjan on March 24, 2012 at 04:42 AM PDT #

>IDE sits at Loading task...

Same here.

Posted by Roel Van der Paal on April 09, 2012 at 07:36 AM PDT #

Do you think it would make sense to create a gradle project type for the netbeans platform . You could then provide templates for the creation of simple and multi project builds. Also I would like to override the error checking and code completion in the java editor to use the classpath provided by the gradle build file. Can you give me any pointers as to how that might be done and if it makes sense to do so?

Posted by guest on October 02, 2012 at 06:36 AM PDT #

Here's the Gradle plugin:

Posted by Geertjan on October 02, 2012 at 07:03 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« April 2015