dev@jaxb.java.net

Capturing SchemaGenerator's emitted JAXB error messages

From: <lj_at_jguru.se>
Date: Sat, 18 Jul 2015 13:44:07 +0000 (UTC)

Hello all,

I'm the maintainer of the jaxb2-maven-plugin from Mojohaus (formerly
codehaus).

Re-implementing the SchemaGenerator integration, I wonder what I should
do to capture
any JAXB error messages emitted by the SchemaGenerator compilation
task.

Typically, error messages of the sort shown below are printed by
SchemaGenerator onto the console - but I need to capture it and pipe it
through a Maven Log. Not certain if it is the ErrorReported I must
configure - but if so, how do I access it?

...

Class has two properties of the same name "bar"
        this problem is related to the following location:
                at
se.west.gnat.IncorrectJaxbAnnotationClass.getBar(src/main/java/se/west/
gnat/IncorrectJaxbAnnotationClass.java:13)
                at
se.west.gnat.IncorrectJaxbAnnotationClass(src/main/java/se/west/gnat/In
correctJaxbAnnotationClass.java:7)
        this problem is related to the following location:
                at
se.west.gnat.IncorrectJaxbAnnotationClass.bar(src/main/java/se/west/gna
t/IncorrectJaxbAnnotationClass.java:11)
                at
se.west.gnat.IncorrectJaxbAnnotationClass(src/main/java/se/west/gnat/In
correctJaxbAnnotationClass.java:7)