I have a big problem with jaxb plugin. I have a project A where I have src/main/resources/xsd/common.xsd file. In this project I use cxf-xjc-plugin to generate java classes. I have also my episod file under src/main/resources/META-INF called sun-jaxb.episode
Next, I have project B which has maven dependency to project A. In this project I have src/main/resources/catalog.txt
PUBLIC "http://www.some_path" "maven:GROUP_ID_OF_PROJECT_A:ARTIFACT_ID_OF_PROJECT_A:jar::!/common.xsd"
In project B I have pom file with jaxb plugin
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<configuration>
<extension>true</extension>
<episodes>
<episode>
<groupId>GROUP_ID_OF_PROJECT_A</groupId>
<artifactId>ARTIFACT_ID_OF_PROJECT_A</artifactId>
</episode>
</episodes>
<catalogs>
<catalog>src/main/resources/catalog.txt</catalog>
</catalogs>
</configuration>
</plugin>
Next, I have in project B
src/main/resources/other/xsd my main.xsd
file where I use type definitions from common.xsd
I have xmlns:cmns="http://www.some_path" // it is the same as in catalog.txt and
<xs:import namespace="http://www.some_path"/>
but the problem is that I get error undefined simple or complex type , because it doesn't recognize cmns
I use this plugin to solve the public import of the xsd
Plugin for pom.xml of project A
Plugin for pom.xml of project B
You must perform a mvn install of project A before the project B
Add this plugin to add to source target generated classes
Remember to perform Maven - update project