Create a new Gradle Project in Eclipse fails - eclipse

Creating a new Gradle project fails with,
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.3-bin.zip'.
If I click on finish then I see the problem - Could not run phased build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.3-bin.zip'.
Could not determine the class-path for class org.gradle.tooling.internal.consumer.connection.InternalPhasedActionAdapter.

This seems to be the following, not yet fixed issue on macOS Big Sur:
Eclipse Buildship issue #1050: Could not run phased build action using Gradle distribution '.../gradle-6.7-bin.zip': Java home is different
You might comment and/or propose a patch there.

Related

eclipse gradle Could not run phased build action

I am trying to run some gradle project on windows using eclipse. it is rapid miner extension template. but eclipse keeps showing this error:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.1.1-bin.zip'.
com.google.common.util.concurrent.ExecutionError: java.lang.NoClassDefFoundError: org/gradle/api/internal/java/JavaLibrary
java.lang.NoClassDefFoundError: org/gradle/api/internal/java/JavaLibrary
org/gradle/api/internal/java/JavaLibrary
org.gradle.api.internal.java.JavaLibrary
i tried different gradle versions and different configs. but it keeps showing this error. i need to fix this.
What gradle task did you try to run?
The extension template is used to create new extensions for RapidMiner Studio.
A detailed guide how to use it is found here:
https://docs.rapidminer.com/latest/developers/extensions/
So your first step should be to adapt the build.gradle file and then run the initializeExtensionProject task.
Afterwards you can write your Java code to build a new RapidMiner operator for example and then run the installExtension task to install the new extension on your local version of RapidMiner Studio.

eclipse new gradle project hold on task init

I am using gradle 5.2, eclipse 2018-12, buildship 3.0.
I specify the gradle local installation in eclipse config.
However when I try to create a new gradle project, it always hold on task:init,
there is no gradle project is created.
Like above screenshot shows, it always say " task:init ", what is my problem?
It would be good to try on creating this project from a command line, just to see if there is some output generated on console. I don't know what project you need specifically, but try for example:
gradle init --type java-application
Then we could see it problem occurs. If not, then it's an issue with your Eclipse setup.
After I update the buildship from 3.0.0 to 3.0.1, now I can create success!
I just had the same issue.
I happened to also have the Gradle console open in Eclipse and I can see that there is a prompt for Groovy/Kotlin being presented.
Eclipse: 18.12, Gradle: 5.4.1, Buildship: 3.0.0.v20181106-1441-m
Using Eclipse to update from the "Latest Eclipse Release" software site to Eclipse 19.3 with Buildship 3.1 and it worked perfectly.

Debug Gradle application with instrumented files

I have Eclipse Neon 4.6.2 and Gradle 4.3 installed locally. My goal is to build and debug a desktop gradle application written in Java.
In command line, to execute the application I have to run gradle clean build --no-daemon to generate instrumented class files. After that, I successfully execute the application.
I've tried doing the same in Eclipse because I need to run it with the debugger, so I've installed the Gradle plugin for Eclipse and launched clean build task with --no-daemon in program arguments section, but I´m getting this error:
I have no idea why isn't being recognized --no-daemon option which is one of the arguments of gradle build task.
After doing that, I would have to debug it as normal Java application?
Thank you!
You cannot run Gradle inside IDE without using daemon.
See https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:tools_and_ides
The Gradle Tooling API (see Chapter 14, Embedding Gradle using the Tooling API), that is used by IDEs and other tools to integrate with Gradle, always use the Gradle Daemon to execute builds. If you are executing Gradle builds from within you're IDE you are using the Gradle Daemon and do not need to enable it for your environment.

Debugging a Gradle 1.12 dependency resolution issue

I am using Gradle 1.12 to build an Android library. The build script works fine and the artifacts are installed to both a Maven local repository and deployed (using an S3 wagon Gradle plugin) to a remote Maven repository. When these artifacts are referenced by a Gradle (1.12) build of a sample app using the Maven local repo, all works fine. When the remote repository is used, a Gradle dependency resolution error is reported [details on the error will be provided later].
To get more information about the problem in order to fix my script or file a bug report, I would like to do some debugging of Gradle 1.12 while the sample app build script runs. Eclipse would seem to have the debugger of choice but configuring Eclipse is the subject of this post.
Following advice on the Gradle forums, it is straightforward to configure Gradle startup options to suspend on startup and await a connection from a client debugger (Eclipse).
Configuring Eclipse to do this is proving difficult. At first glance, it would seem that one needs a Gradle plugin. Spring Source provides a recommended one. But this plugin appears to bury and use Gradle 1.10. Perhaps upgrading this plugin to use 1.12 is easy and an answer that details how to do this would be a great answer.
The critical pieces of the answer I am looking for will enable me to place breakpoints in Gradle classes and step through source code until I either find a bug or figure out what I might be doing incorrectly in my build script.
Alternative approaches, such as using Intellij or Android Studio would be good answers as well if accompanied by details and/or references that make it clear how to enable the Gradle debugging process.
Debugging Gradle works exactly the same as (remotely) debugging any other Java application. No Gradle plugin is needed for this. In a nutshell, you need to start a remote debugging session from an Eclipse project that has Gradle sources. One way to create such a project is to clone the Gradle GitHub repository and run gradlew eclipse.

Creating gradle project in eclipse

I play with gradle support in STS. When I try to create a gradle project via eclipse gradle wizard, I get the following error:
Server returned HTTP response code: 502 for URL: http://downloads.gradle.org/distributions/gradle-1.0-rc-2-all.zip
Therefor, there are 2 questions from my side:
Why does gradle even try to download the distribution from remote
server if I have it locally installed?
Where shoud I indicate to
use local version of gradle distibution?
PS. My PC is under the proxy which prohibits downloading zip archives.
My best guess is that you chose "use Gradle wrapper" in the Gradle project import wizard. The downloads generally work fine, but might not work anymore for very old Gradle versions such as 1.0-rc-2. To solve this problem, you can either upgrade to a newer Gradle version, or point the wizard to a local Gradle installation.