0

I'm using

<cxf-version>3.4.4</cxf-version>
<springframework.version>4.1.6.RELEASE</springframework.version>
<slf.version>1.7.9</slf.version>

<dependency>
    <groupId>javax.xml.bind</groupId>
    <artifactId>jaxb-api</artifactId>
    <version>2.3.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-core</artifactId>
    <version>2.3.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.sun.xml.bind</groupId>
    <artifactId>jaxb-impl</artifactId>
    <version>2.3.0</version>
    <scope>provided</scope>
</dependency>

then in java:

final Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
jaxbUnmarshaller.setSchema(schema);

but then there is an error while An error has occurred in JavaDocs report generation:

[ERROR] /builds/provisioning/target/generated-sources/cxf/at/ActionType.java:26: error: bad use of '>'
[ERROR]  * &lt;complexType name="actionType">

it seems like < is correctly escaped into &lt; but > is not escaped and goes as > which causes error for me. I found jaxbUnmarshaller.setProperty("jaxb.encoding", "Unicode"); but it change nothing in this example.

Michu93
  • 5,058
  • 7
  • 47
  • 80
  • 1
    I think this is "just" a problem with the stricter rules of Java 8+ JavaDoc. See [this SO question for discussions of the issue and potential workarounds](https://stackoverflow.com/questions/22528767/how-to-work-around-the-stricter-java-8-javadoc-when-using-maven). – Joachim Sauer Jul 19 '21 at 12:39
  • 1
    Note that unicode and encoding `<` to `<` are 2 different things. Unicode is about `character <-> byte` conversions, the other is `character <-> html entity` conversion. – Thomas Jul 19 '21 at 12:43
  • 1
    Escaping XML characters does not have anything to do with character encoding, so trying to set the character encoding (by setting the property `jaxb.encoding`) is not going to change anything with regard to this issue. – Jesper Jul 19 '21 at 12:45
  • thanks guys, indeed it works with `Xdoclint:none` however it seems to be more like workaround than proper solution. I'll try to play with it some more time. @Edit on website linked by @JoachimSauer there is a comment about `jaxb`, I think it's worth to keep in mind - I tried to use the newest version of `cxf` and `jaxb` but still failing so it seems much more resilient to not generate it for code which I can't change. – Michu93 Jul 20 '21 at 08:02

1 Answers1

0

There is a way to fix instead of using <additionalparam>Xdoclint:none</additionalparam>. I used all newest versions of cfx and jaxb in pom.xml and worked (generated &lt and &gr instead of < and >) so seems it was fixed in jaxb lib.

(It didn't work for me earlier because of versions of these in poms and parent pom)

Michu93
  • 5,058
  • 7
  • 47
  • 80