Monday, November 12, 2018

Compilation issue on GWT 2.8.2 (modular maven project)

Hello, I'm using the Thomas Broyer fantastic plugin[1] for maven to split my project into multiple subproject (client, shared and server).
Until now I used GWT version 2.8.1, but today I started a new project and I'd like to use the latest version (2.8.2), and some of the POJOs I use in the shared module will be used also in the server module as a response for some REST call (with Jersey).
Usually I annotate my POJOs with the usual @XmlRootElement to use it also in the response payload of a REST call; but switching to 2.8.2 version of GWT I got the known error:

[INFO]       [ERROR] Errors in 'file:/Users/luca/tmp/gwt/test/test-shared/src/main/java/net/morettoni/GreetingResponse.java'
[INFO]          [ERROR] Line 22: XmlTransient cannot be resolved to a type
[INFO]          [ERROR] Line 4: The import javax.xml.bind cannot be resolved
[INFO]          [ERROR] Line 8: XmlRootElement cannot be resolved to a type
[INFO]          [ERROR] Line 3: The import javax.xml.bind cannot be resolved
[INFO]          [ERROR] Line 31: XmlTransient cannot be resolved to a type

and as I see in the messages in this mailing list the solution is to add this extra dependency:

<dependency>
  <groupId>javax.xml.bind</groupId>
  <artifactId>jaxb-api</artifactId>
  <version>...</version>
  <classifier>sources</classifier>
  <scope>provided</scope>
</dependency>

but I continue to get the same error running the SDM code server (mvn gwt:codeserver -pl *-client -am), even if I added the above to the pom.xml of the shared module.

Any idea on how to fix this issue? I'm using JAVA version 1.8 to compile and run the attached example.
Thanks in advance for the help!

No comments:

Post a Comment