Gradle hangs when I run jettyRun on quickstart webApplication sample


(bouiaw) #1

Hi,

With Gradle 1.0-milestone-6 (but also with 1.0-milestone-5), Gradle hangs when I run “gradle jettyRun” on quickstart webApplication sample

Output is :

C:\Apps\gradle\samples\webApplication\quickstart>gradle jettyRun

:compileJava UP-TO-DATE

:processResources UP-TO-DATE

:classes UP-TO-DATE

Building > :jettyRun

And it hangs forever. I am under Windows 7 64 bits, not behind a proxy and have no firewall. I tested this on 2 computers, and the same issue occured.

Regards


(Adam Murdoch) #2

The build waits for jetty to be stopped. And Jetty’s sitting there waiting to serve up HTTP requests.

Though, it looks like the sample pick an arbitrary port to run Jetty on, and doesn’t tell you which one. Which makes it pretty useless. You’ll need to remove these lines from the sample build.gradle:

[jettyRun, jettyRunWar]*.doFirst {
    project.httpPort = portFinder.nextAvailable
    project.stopPort = portFinder.nextAvailable
}

You can also tweak the ‘httpPort = 8163’ setting to choose which port you’d like Jetty to listen on.


(bouiaw) #3

Perfect, it works. Thanks.


(Adam Murdoch) #4

I’ve updated the sample, too.


(Adam Murdoch) #5

Oh, and running ‘gradle jettyRun’ task displays this now:

:compileJava
:processResources
:classes
> Building > :jettyRun > Listening on port 8080

(bouiaw) #6

Nice, I am going to test Gradle on a real life project and blog about this from my “Maven expert user” point of view.