Ekito / spring-boot-gwt

A quickstart spring boot gwt application
48 stars 32 forks source link

Gradle #7

Open alabotski opened 6 years ago

alabotski commented 6 years ago

Hello can you add such example with gradle? I spend few days, but can't decide it =(

buildscript {
  dependencies {
    classpath "de.richsource.gradle.plugins:gwt-gradle-plugin:${gwtGradlePluginVersion}"
//    classpath "org.akhikhl.gretty:gretty:${grettyPluginVersion}"
  }
}

plugins {
  id "org.springframework.boot" version "1.5.9.RELEASE"
  id "net.ltgt.apt" version "0.13"
}

apply plugin: 'war'
apply plugin: 'gwt'
//apply plugin: "org.akhikhl.gretty"

sourceSets {
  main.java.srcDir "src/main/java"
  main.resources.srcDir "src/main/resources"
  test.java.srcDir "src/test/java"
  test.resources.srcDir "src/test/resources"
}

//configurations {
//  'vaadin-client' {
//    exclude module: 'spring-boot-starter-web'
//    exclude module: 'spring-boot-vaadin'
//  }
//}

configurations {
//  all*.exclude group: "ch.qos.logback"
  all*.exclude module: "spring-boot-starter-logging"
  all*.exclude module: "spring-boot-starter-tomcat"
//  gwtSdk.exclude group: 'org.eclipse.jetty'
}

//configurations.gwt {
//  resolutionStrategy {
//    force 'javax.validation:validation-api:1.0.0.GA'
//  }
//}

project.configurations.all { config ->
  config.resolutionStrategy.dependencySubstitution({
    it.substitute(
        it.module('javax.validation:validation-api')
    ).with(
        it.module('javax.validation:validation-api:1.0.0.GA')
    )
  } as Action<DependencySubstitutions>)
}

dependencies {
  compile("org.apache.httpcomponents:httpclient:$httpClientVersion")
  compile("org.apache.httpcomponents:httpmime:$httpMimeVersion")
  compile("org.apache.httpcomponents:httpcore:$httpCoreVersion")

  compile("javax.inject:javax.inject:$javaxInjectVersion")
  compile("com.google.guava:guava-gwt:$guavaVersion")
  compile("com.google.gwt.inject:gin:$ginVersion")
  compile("com.google.gwt:gwt-user:$gwtVersion")
  compile("com.google.gwt:gwt-dev:$gwtVersion")
  compile("com.gwtplatform:gwtp-mvp-client:$gwtpVersion")
  compile("com.googlecode.gwt-charts:gwt-charts:$gwtChartsVersion")
  compile("com.google.gwt.eventbinder:eventbinder:$eventBinderVersion")
  compile("org.fusesource.restygwt:restygwt:$restyGwtVersion")
  compile("org.realityforge.gwt.websockets:gwt-websockets:$gwtWebsocketsVersion")
  compile("de.knightsoft-net:gwt-commons-lang3:$gwtCommonsLang3Version")

  compile("com.github.gwtmaterialdesign:gwt-material:$gwtMaterialVersion")
  compile("com.github.gwtmaterialdesign:gwt-material-addins:$gwtMaterialAddinsVersion")
  compile("com.github.gwtmaterialdesign:gwt-material-themes:$gwtMaterialThemesVersion")
  compile("com.github.gwtmaterialdesign:gwt-material-table:$gwtMaterialTableVersion")

  compile("org.springframework.boot:spring-boot-starter-web:$springBootVersion")

  compile("org.projectlombok:lombok:$lombokVersion")
  apt("org.projectlombok:lombok:$lombokVersion")
}

gwt {
  gwtVersion = '2.8.2'
  maxHeapSize = "4G"
  minHeapSize = "2G";

  modules "com.softeq.verizon.DeviceManager"
  devModules "com.softeq.verizon.DeviceManager"

  compiler {
    strict = true;
    disableClassMetadata = false;
    disableCastChecking = false;
  }

  superDev {
    launcherDir = new File('build/inplaceWebapp')
  }

  logLevel = "INFO"
}

//gretty {
//  springBoot = true
//  springBootVersion = '1.5.9.RELEASE'
//  servletContainer = 'jetty9'
//  httpPort = 8081
//  fileLogEnabled = false
//  scanInterval = 5
//  managedClassReload = false
//}

// execute with "-x compileGwt -x war"
task gwtSuperDevDir(type: Copy) {
  into 'build/inplaceWebapp'
  with war
}

// copy war file to $rootDir/install folder
def installDir = "$rootDir" + "/install/"
task installWar(type: Copy) {
  delete installDir
  def sourceFolder = "$buildDir" + "/libs"
  from sourceFolder
  into installDir
}

clean.doFirst {
  delete "${projectDir}/build"
  delete "${projectDir}/out"
  delete "${projectDir}/war"
}

ext {
  slf4jVersion = "1.7.25"
  log4jVersion = "2.8.2"

  gwtGradlePluginVersion = "0.6"
  grettyPluginVersion = "2.0.0"

  guavaVersion = "23.5-jre"
  junitVersion = "4.12"
  lombokVersion = "1.16.18"
  httpClientVersion = "4.5.4"
  httpMimeVersion = "4.5.4"
  httpCoreVersion = "4.4.8"

  javaxInjectVersion = "1"
  springVersion = "4.3.13.RELEASE"
  springBootVersion = "1.5.9.RELEASE"

  gwtVersion = "2.8.2"
//  gwtMaterialVersion = "2.1-SNAPSHOT"
//  gwtMaterialAddinsVersion = "2.1-SNAPSHOT"
//  gwtMaterialThemesVersion = "2.0"
//  gwtMaterialTableVersion = "2.1-SNAPSHOT"
  gwtMaterialVersion = "2.0"
  gwtMaterialAddinsVersion = "2.0"
  gwtMaterialThemesVersion = "2.0"
  gwtMaterialTableVersion = "1.0-rc4"

  ginVersion = "2.1.2"
  gwtpVersion = "1.6"
  restyGwtVersion = "2.2.2"
  eventBinderVersion = "1.1.0"
  gwtChartsVersion = "0.9.10"
  gwtWebsocketsVersion = "1.2"
  gwtCommonsLang3Version = "3.7-0"
}
alabotski commented 6 years ago

Error

2017-12-15 16:50:21.049:INFO:oejs.Server:main: jetty-9.4.7.v20170914
2017-12-15 16:50:21.069:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2017-12-15 16:50:21.069:INFO:oejs.session:main: No SessionScavenger set, using defaults
2017-12-15 16:50:21.070:INFO:oejs.session:main: Scavenging every 600000ms
2017-12-15 16:50:21.076:WARN:oeju.DeprecationWarning:main: Using @Deprecated Class org.eclipse.jetty.servlets.GzipFilter
2017-12-15 16:50:21.077:WARN:oejs.GzipFilter:main: GzipFilter is deprecated. Use GzipHandler
2017-12-15 16:50:21.078:INFO:oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@4ba2dad3{/,null,AVAILABLE}

2017-12-15 16:50:21.135:INFO:oejs.AbstractConnector:main: Started ServerConnector@6c20a175{HTTP/1.1,[http/1.1]}{127.0.0.1:9876}
The code server is ready at http://127.0.0.1:9876/
2017-12-15 16:50:21.136:INFO:oejs.Server:main: Started @21430ms
Code server started in 19.44 s ms
2017-12-15 16:50:21.256:INFO:oejs.Server:main: jetty-9.4.7.v20170914
2017-12-15 16:50:24.190:INFO:oejshC.ROOT:main: 1 Spring WebApplicationInitializers detected on classpath
2017-12-15 16:50:24.333:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2017-12-15 16:50:24.333:INFO:oejs.session:main: No SessionScavenger set, using defaults
2017-12-15 16:50:24.333:INFO:oejs.session:main: Scavenging every 600000ms
2017-12-15 16:50:24.361:INFO:oejs.AbstractConnector:main: Started ServerConnector@5c17bbc8{HTTP/1.1,[http/1.1]}{127.0.0.1:8888}
Exception in thread "main" java.util.ServiceConfigurationError: org.apache.juli.logging.Log: Provider org.eclipse.jetty.apache.jsp.JuliLog not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.apache.juli.logging.LogFactory.<init>(LogFactory.java:78)
    at org.apache.juli.logging.LogFactory.<clinit>(LogFactory.java:66)
    at org.apache.jasper.servlet.JspServlet.<init>(JspServlet.java:68)
    at org.eclipse.jetty.jsp.JettyJspServlet.<init>(JettyJspServlet.java:41)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.eclipse.jetty.server.handler.ContextHandler$Context.createInstance(ContextHandler.java:2535)
    at org.eclipse.jetty.servlet.ServletContextHandler$Context.createServlet(ServletContextHandler.java:1326)
    at org.eclipse.jetty.servlet.ServletHolder.newInstance(ServletHolder.java:1273)
    at org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:614)
    at org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:421)
    at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:760)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:348)
    at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1514)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1476)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:785)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:261)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
    at com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload.doStart(JettyLauncher.java:550)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:131)
    at org.eclipse.jetty.server.Server.start(Server.java:449)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:105)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
    at org.eclipse.jetty.server.Server.doStart(Server.java:416)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.google.gwt.dev.shell.jetty.JettyLauncher.start(JettyLauncher.java:760)
    at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:636)
    at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:923)
    at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:706)
    at com.google.gwt.dev.DevMode.main(DevMode.java:432)
arnaudgiuliani commented 6 years ago

Did you succeed in making it in gradle?

alabotski commented 6 years ago

No I have trouble =(( GWT 2.8.2\ Gradle 4.4.1 S Boot 1.5.9

Thank you in advance

alabotski commented 6 years ago

Can you help me?

arnaudgiuliani commented 6 years ago

Quiet busy actually :/ If I can do something, I will notify you