mojohaus / jaxb2-maven-plugin

JAXB2 Maven Plugin
https://www.mojohaus.org/jaxb2-maven-plugin/
Apache License 2.0
105 stars 76 forks source link

Schemagen with createJavaDocAnnotations=true cannot handle constants in @XmlType-annotation #145

Open umefjord opened 5 years ago

umefjord commented 5 years ago

Same problem as in https://github.com/mojohaus/jaxb2-maven-plugin/issues/25, but occurs when assigning a constant to the name-attribute of XmlType annotation.

Example:

/**
* The documentation that I need in my XSD....
*/
@XmlType(name = MyClass.MY_CONSTANT)
public class MyClass {
    public static final String MY_CONSTANT = "MyClass";
    ...
}

No javadoc added do generated XSD. Our current workaround is to inline the constant strings:

/**
* The documentation that I need in my XSD....
*/
@XmlType(name = "MyClass")
public class MyClass {
    ...
}

The problem seems to be related to the qdox lib which does not evaluate expressions but rather handles the sources as "strings" all the way.