gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 377 forks source link

Running Gradle with GWT Java and Springboot - jetty dependency irritation #9505

Closed JohnKVision closed 7 years ago

JohnKVision commented 7 years ago

GWT version:2.8.0 Operating System:G radle

Description
  1. Why am I picking up tons of jetty libraries for doing a simple gwt compilation? I could understand the need for the Jetty jars, if I was running the code server, or including the servlet library, but just for compilation ? Seems like this is coming from the gwt-dev.jar? Here is what my Gradle dependency report looks like:

  2. Is it possible to use released tags for Jetty instead of snapshot variants ? When using Gradle to crawl dependencies for Springboot and GWT it's always a desaster to get this project running.

A workaround for compilation to get running a SpringBoot and GWT project without an desaster ist to explain Gradle to exclude this dependencie:

exclude group: 'org.eclipse.jetty', module: 'apache-jsp'

+--- com.google.gwt:gwt-codeserver:2.8.0-SNAPSHOT
|    \--- com.google.gwt:gwt-dev:2.8.0-SNAPSHOT
|         +--- org.ow2.asm:asm:5.0.3
|         +--- org.ow2.asm:asm-util:5.0.3 (*)
|         +--- org.ow2.asm:asm-commons:5.0.3
|         |    \--- org.ow2.asm:asm-tree:5.0.3 (*)
|         +--- org.eclipse.jetty.websocket:websocket-client:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-io:9.2.14.v20151106
|         |    |    \--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |    \--- org.eclipse.jetty.websocket:websocket-common:9.2.14.v20151106
|         |         +--- org.eclipse.jetty.websocket:websocket-api:9.2.14.v20151106
|         |         +--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |         \--- org.eclipse.jetty:jetty-io:9.2.14.v20151106 (*)
|         +--- org.eclipse.jetty:jetty-webapp:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-xml:9.2.14.v20151106
|         |    |    \--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |    \--- org.eclipse.jetty:jetty-servlet:9.2.14.v20151106
|         |         \--- org.eclipse.jetty:jetty-security:9.2.14.v20151106
|         |              \--- org.eclipse.jetty:jetty-server:9.2.14.v20151106
|         |                   +--- javax.servlet:javax.servlet-api:3.1.0
|         |                   +--- org.eclipse.jetty:jetty-http:9.2.14.v20151106
|         |                   |    \--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |                   \--- org.eclipse.jetty:jetty-io:9.2.14.v20151106 (*)
|         +--- org.eclipse.jetty:jetty-servlets:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-continuation:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-http:9.2.14.v20151106 (*)
|         |    +--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |    \--- org.eclipse.jetty:jetty-io:9.2.14.v20151106 (*)
|         +--- org.eclipse.jetty:jetty-annotations:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-plus:9.2.14.v20151106
|         |    |    +--- org.eclipse.jetty:jetty-webapp:9.2.14.v20151106 (*)
|         |    |    \--- org.eclipse.jetty:jetty-jndi:9.2.14.v20151106
|         |    |         \--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|         |    +--- org.eclipse.jetty:jetty-webapp:9.2.14.v20151106 (*)
|         |    +--- javax.annotation:javax.annotation-api:1.2
|         |    +--- org.ow2.asm:asm:5.0.1 -> 5.0.3
|         |    \--- org.ow2.asm:asm-commons:5.0.1 -> 5.0.3 (*)
|         \--- org.eclipse.jetty:apache-jsp:9.2.14.v20151106
|              +--- org.eclipse.jetty:jetty-util:9.2.14.v20151106
|              +--- org.eclipse.jetty:jetty-server:9.2.14.v20151106 (*)
|              +--- org.eclipse.jetty.toolchain:jetty-schemas:3.1.M0
|              +--- javax.servlet:javax.servlet-api:3.1.0
|              +--- org.mortbay.jasper:apache-jsp:8.0.9.M3
|              |    +--- org.eclipse.jetty.toolchain:jetty-schemas:3.1.M0
|              |    \--- org.mortbay.jasper:apache-el:8.0.9.M3
|              \--- org.eclipse.jetty.orbit:org.eclipse.jdt.core:3.8.2.v20130121
+--- com.google.gwt:gwt-dev:2.8.0-SNAPSHOT (*)
Known workarounds

exclude group: 'org.eclipse.jetty', module: 'apache-jsp'

tbroyer commented 7 years ago

Why am I picking up tons of jetty libraries for doing a simple gwt compilation? I could understand the need for the Jetty jars, if I was running the code server, or including the servlet library, but just for compilation ? Seems like this is coming from the gwt-dev.jar?

There's no "gwt compiler only" artifact for GWT. There could technically be one, but, well, legacy…
Feel free to exclude transitive dependencies you don't actually need (but note that gwt-codeserver does need some of the Jetty dependencies). There's a trade-off too with backwards compatibility and having most things "just work" without the need for additional dependencies. This is debatable, but is the status quo.

Is it possible to use released tags for Jetty instead of snapshot variants ?

These are Jetty release artifacts (the timestamp is part of the version); and in case you're refering to the 3.1.M0 or 8.0.9.M3 versions, these are transitive dependencies; so if you have a problem with those, please file an issue to the Jetty project.

A workaround for compilation to get running a SpringBoot and GWT project without an desaster

Actually, the correct way to build things is to have separate classpaths for GWT (client) and non-GWT (server) compilations; and fortunately Gradle makes it easy-peasy (contrary to, say, Maven, where you're forced to use distinct Maven modules and possibly move files around).