简体   繁体   English

GWT验证-Api GA

[英]GWT Validation-Api GA

My build.gradle 我的build.gradle

buildscript {
  dependencies {
    classpath "de.richsource.gradle.plugins:gwt-gradle-plugin:${gwtPluginVersion}"
    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 module: "spring-boot-starter-logging"
//  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'
//  }
//}

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")
  // Needed for GWT compile and at runtime for RequestBuilder
  // Specify two artifacts as workaround for GRADLE-1934
//  compile('javax.validation:validation-api:1.0.0.GA') {
//    artifact {
//      name = 'validation-api'
//      type = 'jar'
//    }
//    artifact {
//      name = 'validation-api'
//      type = 'jar'
//      classifier = 'sources'
//    }
//  }
  compile("com.gwtplatform:gwtp-mvp-client:$gwtpVersion")

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

  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("org.springframework.boot:spring-boot-starter-web:$springBootVersion")

  testCompile("junit:junit:$junitVersion")

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

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

  modules "com.soft.DeviceManager"
  devModules "com.soft.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
}

I have such error 我有这样的错误

Gradle now uses separate output directories for each JVM language, but this build assumes a single directory for all classes from a source set. This behaviour has been deprecated and is scheduled to be removed in Gradle 5.0
Compiling module com.soft.DeviceManager
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.ConstraintViolationImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/ConstraintViolationImpl.java'
         [ERROR] Line 31: The type ConstraintViolationImpl<T> must implement the inherited abstract method ConstraintViolation<T>.getExecutableReturnValue()
         [ERROR] Line 31: The type ConstraintViolationImpl<T> must implement the inherited abstract method ConstraintViolation<T>.getExecutableParameters()
         [ERROR] Line 31: The type ConstraintViolationImpl<T> must implement the inherited abstract method ConstraintViolation<T>.unwrap(Class<U>)
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.GwtValidatorContext'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/GwtValidatorContext.java'
         [ERROR] Line 29: The type GwtValidatorContext must implement the inherited abstract method ValidatorContext.parameterNameProvider(ParameterNameProvider)
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.PropertyDescriptorImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/PropertyDescriptorImpl.java'
         [ERROR] Line 31: The type PropertyDescriptorImpl must implement the inherited abstract method CascadableDescriptor.getGroupConversions()
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java'
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getMessageTemplate()
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getValidationAppliesTo()
   Tracing compile failure path for type 'javax.validation.executable.ExecutableValidator'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.1.0.Final/7d49b53caed9bd81d172807c3e096d24f3c57090/validation-api-1.1.0.Final-sources.jar!/javax/validation/executable/ExecutableValidator.java'
         [ERROR] Line 53: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module?
         [ERROR] Line 94: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module?
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.GwtBeanDescriptorImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/GwtBeanDescriptorImpl.java'
         [ERROR] Line 38: The type GwtBeanDescriptorImpl<T> must implement the inherited abstract method BeanDescriptor.getConstraintsForConstructor(Class<?>...)
         [ERROR] Line 38: The type GwtBeanDescriptorImpl<T> must implement the inherited abstract method BeanDescriptor.getConstrainedConstructors()
         [ERROR] Line 38: The type GwtBeanDescriptorImpl<T> must implement the inherited abstract method BeanDescriptor.getConstraintsForMethod(String, Class<?>...)
         [ERROR] Line 38: The type GwtBeanDescriptorImpl<T> must implement the inherited abstract method BeanDescriptor.getConstrainedMethods(MethodType, MethodType...)
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java'
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getMessageTemplate()
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getValidationAppliesTo()
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/PropertyDescriptorImpl.java'
         [ERROR] Line 31: The type PropertyDescriptorImpl must implement the inherited abstract method CascadableDescriptor.getGroupConversions()
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.ConstraintValidatorContextImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/ConstraintValidatorContextImpl.java'
         [ERROR] Line 46: The type ConstraintValidatorContextImpl<A,T>.ConstraintViolationBuilderImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.addPropertyNode(String)
         [ERROR] Line 39: The type ConstraintValidatorContextImpl<A,T> must implement the inherited abstract method ConstraintValidatorContext.unwrap(Class<T>)
         [ERROR] Line 112: The type ConstraintValidatorContextImpl<A,T>.NodeBuilderDefinedContextImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext.addPropertyNode(String)
         [ERROR] Line 79: The type ConstraintValidatorContextImpl<A,T>.NodeBuilderCustomizableContextImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext.addBeanNode()
         [ERROR] Line 79: The type ConstraintValidatorContextImpl<A,T>.NodeBuilderCustomizableContextImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext.addPropertyNode(String)
         [ERROR] Line 112: The type ConstraintValidatorContextImpl<A,T>.NodeBuilderDefinedContextImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext.addBeanNode()
         [ERROR] Line 46: The type ConstraintValidatorContextImpl<A,T>.ConstraintViolationBuilderImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.addParameterNode(int)
         [ERROR] Line 46: The type ConstraintValidatorContextImpl<A,T>.ConstraintViolationBuilderImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.addBeanNode()
         [ERROR] Line 142: The type ConstraintValidatorContextImpl<A,T>.NodeContextBuilderImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder.addBeanNode()
         [ERROR] Line 142: The type ConstraintValidatorContextImpl<A,T>.NodeContextBuilderImpl must implement the inherited abstract method ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder.addPropertyNode(String)
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.NodeImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/NodeImpl.java'
         [ERROR] Line 25: The type NodeImpl must implement the inherited abstract method Path.Node.as(Class<T>)
         [ERROR] Line 25: The type NodeImpl must implement the inherited abstract method Path.Node.getKind()
   Tracing compile failure path for type 'com.google.gwt.validation.client.impl.ConstraintDescriptorImpl'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/impl/ConstraintDescriptorImpl.java'
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getMessageTemplate()
         [ERROR] Line 35: The type ConstraintDescriptorImpl<T> must implement the inherited abstract method ConstraintDescriptor<T>.getValidationAppliesTo()
   Tracing compile failure path for type 'javax.validation.ParameterNameProvider'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/javax.validation/validation-api/1.1.0.Final/7d49b53caed9bd81d172807c3e096d24f3c57090/validation-api-1.1.0.Final-sources.jar!/javax/validation/ParameterNameProvider.java'
         [ERROR] Line 54: No source code is available for type java.lang.reflect.Method; did you forget to inherit a required module?
         [ERROR] Line 44: No source code is available for type java.lang.reflect.Constructor<T>; did you forget to inherit a required module?
   Tracing compile failure path for type 'com.google.gwt.validation.client.GwtConstraintValidatorFactory'
      [ERROR] Errors in 'jar:file:/home/lesharb/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.8.2/a2b9be2c996a658c4e009ba652a9c6a81c88a797/gwt-user-2.8.2.jar!/com/google/gwt/validation/client/GwtConstraintValidatorFactory.java'
         [ERROR] Line 26: The type GwtConstraintValidatorFactory must implement the inherited abstract method ConstraintValidatorFactory.releaseInstance(ConstraintValidator<?,?>)
   [ERROR] Aborting compile due to errors in some input files

How to make Gradle use validation-api 1.0 GA? 如何使Gradle使用validation-api 1.0 GA? This dependence pulls Gretty. 这种依赖性拉动了格雷蒂。 Completely eliminate Validation-Api 1.1.0 Final. 完全消除Validation-Api 1.1.0 Final。 Or you can make GWT use Validation-Api 1.0 GA 或者,您可以让GWT使用Validation-Api 1.0 GA

In the future I want to connect more Spring Boot will not there any difficulties? 将来我想连接更多的Spring Boot会不会有什么困难?

Gwt + Spring Boot + Gradle did not find any examples on the Internet =( Gwt + Spring Boot + Gradle在Internet上找不到任何示例=(

gradle versions gradle版本

ext {
  slf4jVersion = "1.7.25"
  logbackVersion = "1.2.3"
  commonsLoggingVersion = "1.2"

  guavaVersion = "23.0"
  junitVersion = "4.12"
  lombokVersion = "1.16.18"
  httpclientVersion = "4.5.3"
  httpmimeVersion = "4.5.3"
  httpcoreVersion = "4.4.8"

  gwtVersion = "2.8.0"
//  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.0.4"
  gwtCommonsLang3Version = "3.7-0"

  gwtGradlePluginVersion = "0.6"
}

You didn't post your gradle.properties with the dependency versions nor did you post the output of gradle dependencies so hard to say definitely as that dependency can be pulled in from multiple sources. 您既没有发布带有依赖版本的gradle.properties ,也没有发布gradle dependencies的输出,因此很难gradle dependencies ,因为可以从多个来源提取依赖。

But one way is forcing it via the resolution strategy like this: 但是一种方法是通过这样的解决策略强制执行此操作:

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>)    
}

same error i was getting so i have added two jars in class path which comes in gwt 2.8.2 zip 我得到的是同样的错误,所以我在gwt 2.8.2 zip中的类路径中添加了两个jar

validation-api-1.0.0.GA-sources.jar

gwt-servlet-deps.jar

apart from these u need to have all below jars in class path 除了这些,您需要在类路径中包含所有下面的jar

gwt-validation.jar

gwt-user.jar

gwt-servlet.jar

validation-api.jar

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM