view raw
Harold L. Brown Harold L. Brown - 6 months ago 44
Java Question

IntelliJ doesn't recognize import statements for JAXB classes

I'm using IntelliJ IDEA 14 as IDE and jaxb2-maven-plugin for creating Java classes from XSD files.

When compiling my module with Maven no errors are displayed. Even when using the command

in IntelliJ no errors are displayed in the status popup.

But in the files itself and in the project browser compile errors are constantly displayed. It seems like IntelliJ doesn't recognize the import statements of my classes in the target folder.

The error statements look like this (bold means coloured in red):

package seems to be invisible for the IDE. How can I fix this?


After using this workaround and recreating my project it worked again.


If you use maven-jaxb2-plugin with multiple schema for example


with multiple xsd/xjb in it. One with:

        <jaxb:package name="com.test.a"/>

Another with:

        <jaxb:package name="com.test.b"/>