jiakuan / gwt-gradle-plugin

Gradle plugin to support GWT related tasks.
https://gwt-gradle.docstr.org
Other
63 stars 34 forks source link

I'm having trouble using this plugin with the simple demo application from gwtproject.org/gettingstarted.html #59

Closed martonsz closed 2 years ago

martonsz commented 2 years ago

I'm having trouble using this plugin with the simple demo application from gwtproject.org/gettingstarted

After creating the demo application using the webAppCreator and applying a gradle wrapper setup. I don't know how to apply this gradle plugin and rearrange the war/webapp-folder to make it work. The webAppCreator uses ant. So it needs to be altered to work with gradle.

Can someone please show me the simplest setup for the demo application created by the webAppCreator

./webAppCreator -out MyWebApp com.mycompany.mywebapp.MyWebApp
jiakuan commented 2 years ago

https://github.com/jiakuan/gwt-gradle-plugin/tree/master/examples

Here are many examples about how to use this plugin.

No ant needed, just use Gradle instead.

martonsz commented 2 years ago

I have managed to make it work with the demo application. But only if I use jdk 8.

It stops working when I change sourceCompatibility and targetCompatibility to jdk 11.

I also tried this:

  java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(11)
    }
  }
jiakuan commented 2 years ago

Did you see any errors? I will test with Java 11 when I have time.

On Sun, 17 Apr 2022 at 5:23 pm, Márton Szücs @.***> wrote:

I have managed to make it work with the demo application. But only if I use jdk 8.

It stops working when I change sourceCompatibility and targetCompatibility to jdk 11.

I also tried this:

java { toolchain { languageVersion = JavaLanguageVersion.of(11) } }

— Reply to this email directly, view it on GitHub https://github.com/jiakuan/gwt-gradle-plugin/issues/59#issuecomment-1100839222, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAECF5HS6NUY4CPTXTBNYA3VFPKCTANCNFSM5TMZVEPA . You are receiving this because you commented.Message ID: @.***>

martonsz commented 2 years ago

Sorry for the terrible error report. I will try to make a better one when I'm back at work and my children don't interrupt me :)

The problem I have is that devmode (gwtDev) is not working when using java 11. The GWT Development Mode GUI starts. But when I click "Launch Default Browser" javascript is not compiled. I get this in the browser;

Error 503

HTTP ERROR: 503

Problem accessing /MyWebApp.html. Reason:

    Service Unavailable
* * *
_Powered by Jetty://_

It starts working again when I upgraded the jetty dependencies. But I'm not an expert at Gradle and don't know if I did it the right way. I added this in the MyWebApp/build.gradle

dependencies {
    gwt 'org.eclipse.jetty:apache-jsp:9.4.46.v20220331'
    gwt 'org.eclipse.jetty:jetty-annotations:9.4.46.v20220331'
    gwt 'org.eclipse.jetty:jetty-servlets:9.4.46.v20220331'
    gwt 'org.eclipse.jetty:jetty-webapp:9.4.46.v20220331'
}

When I try with a version >= 10.x it starts to complain about not finding a class. I think it just wants an implementation for slf4j but I did not managed to add logback to the dependencies so that the gwtDev task uses it.

System info

\------------------------------------------------------------
Gradle 7.4.2
\------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.14.1 (Eclipse Adoptium 11.0.14.1+1)
OS:           Windows 10 10.0 amd64

Gradle Plugin version: 1.1.18

I will get back with more and better info soon.

jiakuan commented 2 years ago

GWT devmode has been replaced by Super Dev Mode, which works better for modern browsers.

https://www.gwtproject.org/articles/superdevmode.html

Yes, it may need some tweaks to make the dependencies right.

martonsz commented 2 years ago

Both jetty and cargo plugins seem a bit old.

Can you make an example using gretty?

martonsz commented 2 years ago

I managed to make it work with super dev mode using the follwing versions:

I created a repo for my sample project if someone is interested: https://github.com/martonsz/jiakuan-gwt-gradle-plugin-sample

jiakuan commented 2 years ago

Thanks for arranging the sample project. I will put it into the examples folder when I get a chance.