treblereel / gwtproject

Apache License 2.0
3 stars 4 forks source link

Missing Java validation classes #12

Open zbynek opened 2 years ago

zbynek commented 2 years ago

While using the artifact org.treblereel.gwt.gwtproject.widgets:gwt-widgets:202203291 I get a lot of errors like this:

 Tracing compile failure path for type 'com.google.gwt.validation.client.constraints.SizeValidatorForArrayOfObject'
      [ERROR] Errors in 'jar:file:/Users/Shared/Jenkins/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.9.0/d68c92135dca7f9880870fb379ded95b96ac8ad9/gwt-user-2.9.0.jar!/com/google/gwt/validation/client/constraints/SizeValidatorForArrayOfObject.java'
         [ERROR] Line 29: No source code is available for type javax.validation.ConstraintValidatorContext; did you forget to inherit a required module?
      [ERROR] Errors in 'jar:file:/Users/Shared/Jenkins/.gradle/caches/modules-2/files-2.1/com.google.gwt/gwt-user/2.9.0/d68c92135dca7f9880870fb379ded95b96ac8ad9/gwt-user-2.9.0.jar!/com/google/gwt/validation/client/constraints/AbstractSizeValidator.java'
         [ERROR] Line 27: No source code is available for type javax.validation.constraints.Size; did you forget to inherit a required module?
         [ERROR] Line 27: No source code is available for type javax.validation.ConstraintValidator<A,T>; did you forget to inherit a required module?

I tried adding <inherits name="javax.validation.Validation"/> to the module that also inherits widgets via <inherits name="org.gwtproject.user.Widgets" />, but got the same error. I'm using Vertispan maven repo together with central to resolve maven dependencies. Tested with Java 8 + Gradle + both Windows and MacOS.

treblereel commented 2 years ago

@zbynek thanks, i ll take a look.

zbynek commented 2 years ago

@treblereel did you have time to check this? If not, could you please point me to some GWT 2 project using this new widgets library?

treblereel commented 2 years ago

@zbynek Hello, it's not my top priority ... if you use gwt2, i think it's better to use existing validation api or switch to this great project https://gitlab.com/ManfredTremmel/gwt-bean-validators.

zbynek commented 2 years ago

@treblereel thanks, but I'm not looking for a validation library. I just want to resolve the compilation errors that I get when I use the widget library with Gwt2. The long term goal is migrating from Gwt2 to j2cl, I was hoping that switching widgets to this library would be a useful intermediate step.

treblereel commented 2 years ago

@zbynek i have answered to you in gitter

treblereel commented 2 years ago

@zbynek please check https://github.com/treblereel/gwtproject/tree/development, if issue fixed, i ll publish new release

zbynek commented 2 years ago

I still had some issues related to validation, most likely because several com.google modules were still inherited and that caused conflicts between supersourced javax.validation from the old modules and the new one. Partial fix proposed in https://github.com/treblereel/gwtproject/pull/14