Git Product home page Git Product logo

Comments (17)

kdvolder avatar kdvolder commented on April 20, 2024

You will need to provide more details. I have no idea what your problem is. Describe precisely what it is you are trying to do, and what goes wrong.

I will say however that the tooling don't run gradle by executing a shell process like './gradlew ...'. It uses the gradle tooling API. The tooling API will not use the wrapper but it will read the wrapper.properties file and obey it. That is, unless you do something non-standard to your project, like editing the wrapper script and move the wrapper files to a non-standard location. In that case gradle tooling api will not be able to find the wrapper properties and not obey them.

Since your description of the problem is a little vague, I really don't know if this information is relevant to your issue, but its the best I can do.

If you have a problem with a specific project, it would help to include a sample project (cut down version of your project that still demonstrates the issue). I can then try to reproduce and diagnose the problem.

from eclipse-integration-gradle.

MBurchard avatar MBurchard commented on April 20, 2024

eclipse installation details
gradle preferences
Also the other Options are set to default cause I just created a new workspace for this test.
Now I created a new Java Project Demo01.
Then I right click the project, click on Configure > Convert to Gradle Project.
Now it starts working. The Project Icon changes but the task doesn't stop.
converted project
After 5 minutes I still wait for it to finish...
task running
It hangs at 25%.
I havent't found any additional output in any console or so.
Eclipse must be killed now cause you can't work anymore...

from eclipse-integration-gradle.

BoykoAlex avatar BoykoAlex commented on April 20, 2024

Hmm... I've tried that in STS 3.5.0 with Groovy Eclipse and Gradle Eclipse Integration from this update site: http://dist.springsource.com/release/TOOLS/update/e4.3/ Platform is Mac OSX. Probably some corner case scenario... Will try Win7 and plain eclipse + Greclipse and Gradle Eclipse integration. BTW, is that your initial setup? Eclipse for JEE dev + Groovy Eclipse + Gradle Eclipse Integration?

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

Just to clarify something that is probably not obvious. THe "Convert To Gradle Project" doesn't really convert Java projects to Gradle projects. All it does is enable the Gradle tooling on a project by adding "Gradle Nature".
For the project to work properly it really already has to be a Gradle project (i.e. have a build.gradle file).

If you wanted to create a simple Java gradle project you would be better to use 'New Gradle Project' and choose the 'Java Quickstart' sample.

If you have an existing gradle project and want to get it inside of Eclipse. Then you should import it with Gradle Import Wizard. You should rarely have to use the 'Convert to Gradle Project' menu.

The hanging thing, of course, is an issue regardless.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

Do you have any Firewall or Network proxy in your network environment? It is possible this is actually causing the hang. It could be interferring with either Gradle tooling connecting locally to the Gradle daemon or the gradle daemon connecting to the internet. Either one of these could cause the process to hang.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

To diagnose the hang it is useful to collect a stacktrace. 'jps' and 'jstack' are commandline tools part of the JDK that will allow you to determine the process id of a Java process (jps) and then extract a stackdump (jstack).

Can you try to collect a stack dump of the hanging Eclipse instance as well as the Gradle Daemon.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

Possibly related: https://issuetracker.springsource.com/browse/STS-3495
That particular problem is reportedly fixed in recent version of Gradle.

This is not the first and only time I've heard of issues connecting to the daemon on Windows.
But I can't find other bug tickets at this time.

The problem is usually not a bug in the tooling but something else preventing the connection between eclipse and the daemon.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

Okay... one more idea. When you use 'gradle wrapper default' it will need to download a gradle distribution (the first time a gradle operation is used).

Since you say you specifically have problem with that scenario... Maybe the problem is the distribution either can't be downloaded or just takes a very long time because you have a slow internet connection.

All of these ideas are only guesses. The stacktraces will help determine what's going on.

PS: I just tried the 'convert to Gradle project' and it works for me. I do see a bit of a pause around 25% also, which I think is the 'download gradle step' but I have fast enough internet connection it is only a few seconds.

from eclipse-integration-gradle.

BoykoAlex avatar BoykoAlex commented on April 20, 2024

It might be that during the conversion of Java project to Gradle project it may ask you to confirm network access permissions on Windows (i got that "allow access" dialog on Win7) where you pick the decision allow access and it succeeds. Perhaps you either don't get this dialog or selected something previously that disallows network access in this case... Just a guess... Otherwise i couldn't reproduce this on Win7.

from eclipse-integration-gradle.

MBurchard avatar MBurchard commented on April 20, 2024

Good Morning,
so many comments during the night, so I'll give my best to respond.

BTW, is that your initial setup? Eclipse for JEE dev + Groovy Eclipse + Gradle Eclipse Integration?

What do you mean with initial setup? I used to work with Eclipse for JEE for years now. Since Spring 4 was released and all those good small tutorials with Gradle came up, I installed Gradle IDE and cause the scripts are groovy I also installed Groovy Eclipse.

Just to clarify something that is probably not obvious. THe "Convert To Gradle Project" doesn't really convert Java projects to Gradle projects. All it does is enable the Gradle tooling on a project by adding "Gradle Nature".
For the project to work properly it really already has to be a Gradle project (i.e. have a build.gradle file).

I know that. I used to write a small build.gradle and then using the Gralde Import wizard, but the given example shows the problem in the simplest possible scenario.
Also importing is not possible, It stuck after clicking on Build Model.

# build.gradle
apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
    mavenCentral()
    mavenLocal()
}

gradle import stuck

Do you have any Firewall or Network proxy in your network environment?

In the office we have a firewall, but Gradle and Gradle Wrapper is working from the commmand line.
At Home I don't have a firewall.
In Addition there is the standard Windows firewall but with default settings. It asked my sometime before when starting with Gradle but since then it's quiet.
The Problem is always there, not only in the office or at home.

Okay... one more idea. When you use 'gradle wrapper default' it will need to download a gradle distribution (the first time a gradle operation is used).
Since you say you specifically have problem with that scenario... Maybe the problem is the distribution either can't be downloaded or just takes a very long time because you have a slow internet connection.

The distribution was downloaded before. In addition my Internet connection speed is always more then 25 MBit/s.
An additional information at this point. If I use the following build.gradle

apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
    mavenCentral()
    mavenLocal()
}
task wrapper(type: Wrapper) {
        gradleVersion = '1.10' # 1.11 is also working here
}

And have the wrapper initialized by command line gradle wrapper the import will succeed and not stuck.

To diagnose the hang it is useful to collect a stacktrace. 'jps' and 'jstack' are commandline tools part of the JDK that will allow you to determine the process id of a Java process (jps) and then extract a stackdump (jstack).

I never made that, can you please explain how I do that with Eclipse so I don't have to research be myself and can focus on sending you the logs fast.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

I never made that, can you please explain how I do that with Eclipse so I
don't have to research be myself and can focus on sending you the logs fast.

You don't do that with eclipse. You do it with commandline tools jps and
jstack. They are easy to use and are probably already installed on your
machine.
Just google or read their man page. I understand you may not feel like
doing that, but we are just as busy as you... and this seems to be
a problem that specifically affects you so you will have to do some
'legwork' if you want our help trying to diagnose and fix it.

On Fri, Apr 4, 2014 at 12:59 AM, MBurchard [email protected] wrote:

Good Morning,
so many comments during the night, so I'll give my best to respond.

BTW, is that your initial setup? Eclipse for JEE dev + Groovy Eclipse +
Gradle Eclipse Integration?

What do you mean with initial setup? I used to work with Eclipse for JEE
for years now. Since Spring 4 was released and all those good small
tutorials with Gradle came up, I installed Gradle IDE and cause the scripts
are groovy I also installed Groovy Eclipse.

Just to clarify something that is probably not obvious. THe "Convert To
Gradle Project" doesn't really convert Java projects to Gradle projects.
All it does is enable the Gradle tooling on a project by adding "Gradle
Nature".
For the project to work properly it really already has to be a Gradle
project (i.e. have a build.gradle file).

I know that. I used to write a small build.gradle and then using the
Gralde Import wizard, but the given example shows the problem in the
simplest possible scenario.
Also importing is not possible, It stuck after clicking on Build Model.

build.gradle

apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
mavenCentral()
mavenLocal()
}

[image: gradle import stuck]https://cloud.githubusercontent.com/assets/4256302/2612585/5e10cd7a-bbc6-11e3-8f31-a0633ca705f2.png

Do you have any Firewall or Network proxy in your network environment?

In the office we have a firewall, but Gradle and Gradle Wrapper is working
from the commmand line.
At Home I don't have a firewall.
In Addition there is the standard Windows firewall but with default
settings. It asked my sometime before when starting with Gradle but since
then it's quiet.
The Problem is always there, not only in the office or at home.

Okay... one more idea. When you use 'gradle wrapper default' it will need
to download a gradle distribution (the first time a gradle operation is
used).
Since you say you specifically have problem with that scenario... Maybe
the problem is the distribution either can't be downloaded or just takes a
very long time because you have a slow internet connection.

The distribution was downloaded before. In addition my Internet connection
speed is always more then 25 MBit/s.
An additional information at this point. If I use the following
build.gradle

apply plugin: 'java'
sourceCompatibility = 1.7
repositories {
mavenCentral()
mavenLocal()
}
task wrapper(type: Wrapper) {
gradleVersion = '1.10' # 1.11 is also working here
}

And have the wrapper initialized by command line gradle wrapper the
import will succeed and not stuck.

To diagnose the hang it is useful to collect a stacktrace. 'jps' and
'jstack' are commandline tools part of the JDK that will allow you to
determine the process id of a Java process (jps) and then extract a
stackdump (jstack).

I never made that, can you please explain how I do that with Eclipse so I
don't have to research be myself and can focus on sending you the logs fast.

Reply to this email directly or view it on GitHubhttps://github.com//issues/28#issuecomment-39540375
.

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

Closing issue. Cannot reproduce /fix without more info.

If you have more info that may help please raise a new issue ticket on the STS issue tracker:
https://issuetracker.springsource.com/browse/STS

While we do keep an eye on the github tracker, it is not our main issue tracker.

from eclipse-integration-gradle.

jmfelixr avatar jmfelixr commented on April 20, 2024

I am suffering the same problem with Windows 7.

from eclipse-integration-gradle.

MBurchard avatar MBurchard commented on April 20, 2024

It's clear. Our whole developer team has this problem under Windows 7 or 8.1.
So it's really simple to reproduce.
The problem is not existent under Mac OS und Linux (Ubuntu 14.04).
I switched to Ubuntu and my colleagues don't use the wrapper!

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

As I said there's not much that we can do. The only way we can have a chance of getting some idea what is getting stuck is if you collect a trace of the stuck processes. That may shed some light.
Even then I can't promise you anything.

from eclipse-integration-gradle.

juanfezero avatar juanfezero commented on April 20, 2024

Same problem on windows 8.
When importing a gradle project from 'import gradle project' it hangs and I need to kill java process to quit sts.
Using java version "1.8.0_05"
Gradle version 2.0
Windows Firewall deactivated.

This is build.gradle file:

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'

repositories { mavenCentral() }

dependencies {
compile 'org.springframework:spring-core:3.2.3.RELEASE'
compile 'org.springframework:spring-webmvc:3.2.3.RELEASE'

compile 'org.slf4j:slf4j-api:1.7.5'
runtime 'org.slf4j:slf4j-log4j12:1.7.5'

testCompile 'org.springframework:spring-test:3.2.3.RELEASE'

testCompile 'junit:junit:4.11'
testCompile "org.mockito:mockito-core:1.9.5"
testCompile "org.hamcrest:hamcrest-library:1.3"

testCompile 'javax.servlet:javax.servlet-api:3.0.1'
}
test {
         testLogging {
          // Show that tests are run in the command-line output
         events 'started', 'passed'
     }
}
task wrapper(type: Wrapper) { gradleVersion = '1.6' }

from eclipse-integration-gradle.

kdvolder avatar kdvolder commented on April 20, 2024

More useful info than what is in your build.gradle file would jps + jstack stacktraces of the stuck processes (gradle daeimon and STS).

from eclipse-integration-gradle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.