Announcement Announcement Module
No announcement yet.
Gradle Plugin not working Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gradle Plugin not working

    Hello ,

    I have Eclipse Version: Indigo Service Release 2 .

    I was writing a project using gradle . I wrote gradle build file without any tool and ran it through command prompt.

    One of my colleague suggested using STS plugin for Gradle development.

    I have added STS plugin on eclipse. I have also added the Gradle extension .

    The version information is : Spring IDE :Version:

    Now the problem I am facing is :

    when I right click build.gradle I see two option Gradle Build and Gradle Build ...

    1) By Running Gradle Build I see -

    FAILURE: Build failed with an exception.

    * Where:
    Build file '<path>\build.gradle' line: 1

    * What went wrong:
    A problem occurred evaluating root project '<project name>'.
    Cause: Could not find method apply() for arguments [{plugin=java}] on root project '<project name>'.

    * Try:
    Run with -s or -d option to get more details. Run with -S option to get the full (very verbose) stacktrace.


    Total time: 3.432 secs

    2) When I click Gradle Build ...

    nothing happens and I see error in workspace log -Unhandled event loop exception

    I am pasting the event details :

    java.vendor=Sun Microsystems Inc.
    BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
    Framework arguments:  -product org.eclipse.epp.package.jee.product
    Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
    Wed Apr 11 08:46:01 PDT 2012
    Unhandled event loop exception
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
    	at java.util.ArrayList.RangeCheck(Unknown Source)
    	at java.util.ArrayList.get(Unknown Source)
    	at java.util.Collections$UnmodifiableList.get(Unknown Source)
    	at com.breskeby.eclipse.gradle.launchConfigurations.GradleTasksTab.getTasks(
    	at com.breskeby.eclipse.gradle.launchConfigurations.GradleTasksTab.initializeFrom(
    	at org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup.initializeFrom(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupWrapper.initializeFrom(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.displayInstanceTabs(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer$
    	at org.eclipse.swt.custom.BusyIndicator.showWhile(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.inputChanged(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput0(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationTabGroupViewer.setInput(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPropertiesDialog.initializeContent(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.createContents(
    	at org.eclipse.jface.window.Window.create(
    	at org.eclipse.jface.dialogs.Dialog.create(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationsDialog.create(
    	at org.eclipse.debug.ui.DebugUITools.openLaunchConfigurationDialog(
    	at com.breskeby.eclipse.gradle.launchConfigurations.GradleLaunchShortcut.launch(
    	at com.breskeby.eclipse.gradle.launchConfigurations.GradleLaunchShortcut.launch(
    	at com.breskeby.eclipse.gradle.launchConfigurations.GradleLaunchShortcut.launch(
    	at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.launch(
    	at org.eclipse.debug.internal.ui.actions.LaunchShortcutAction.runWithEvent(
    	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(
    	at org.eclipse.jface.action.ActionContributionItem.access$2(
    	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(
    	at org.eclipse.swt.widgets.EventTable.sendEvent(
    	at org.eclipse.swt.widgets.Widget.sendEvent(
    	at org.eclipse.swt.widgets.Display.runDeferredEvents(
    	at org.eclipse.swt.widgets.Display.readAndDispatch(
    	at org.eclipse.ui.internal.Workbench.runEventLoop(
    	at org.eclipse.ui.internal.Workbench.runUI(
    	at org.eclipse.ui.internal.Workbench.access$4(
    	at org.eclipse.ui.internal.Workbench$
    	at org.eclipse.core.databinding.observable.Realm.runWithDefault(
    	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(
    	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(
    	at org.eclipse.ui.internal.ide.application.IDEApplication.start(
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(
    	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.eclipse.equinox.launcher.Main.invokeFramework(
    	at org.eclipse.equinox.launcher.Main.basicRun(
    	at org.eclipse.equinox.launcher.Main.main(

    Please suggest .

    Using Gradle with an IDE is an important factor in adopting Gradle in my organization as other developers use m2eclipse for maven and I have to show if STS-Gradle extension is equally powerful as m2eclipse.


  • #2
    Hi Priyanka,

    The stacktrace you are showing suggest you have some gradle-plugin installed that isn't actually the STS one (I see 'breskeby' in the stacktrace). I know that somebody by that name was working on some Gradle support long before STS started its support. I don't think that the plugin that you are using is supported or maintained anymore by its original author. In any case, it is not supported by us, and you would have to find the original author to get support.

    I'm not certain if perhaps you have both 'breskeby plugin' (for lack of a better name) and the STS gradle plugins installed at the same time. But I'd advise you by starting with an instance of Eclipse/STS that *only* has the STS gradle plugins installed. (Having both installed will just confuse things).

    If you have STS you should be able to install gradle support from the dashboard extension page. Alternatively it can be installed from update site into Eclipse following these instructions:

    To remove the breskeby plugin I can't give you instructions since I don't really know how you have installed it. If you don't know how to remove it, it may be easiest to start with a fresh copy of Eclipse or STS.