title: Using maven jaxb2 plugin, modular compilation using episode and catalog throws Malformed URL error
body: <p>My project contains A.xsd which imports schema as follows from B.xsd which is part of another project:</p>
  
  <pre><code>&lt;xsd:import namespace="http://com.test.schema/common/Context" schemaLocation="http://com.test.schema/common/Context/B.xsd"/&gt;
  </code></pre>
  
  <p>I am trying to use the episode from the project which contains B.xsd so that classes related to B.xsd do not get re-generated when A.xsd is parsed. So I referred <a href="https://weblogs.java.net/blog/kohsuke/archive/2006/09/separate_compil.html?force=741" rel="nofollow">this</a> and <a href="https://github.com/highsource/maven-jaxb2-plugin/wiki/Using-Episodes" rel="nofollow">this</a> to come up with the following configuration:
  Here is the pom.xml</p>
  
  <pre><code>    &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;com.bar.foo&lt;/groupId&gt;
              &lt;artifactId&gt;schema-b&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;dependencies&gt;
      .
      .
      .
      .
      .
      &lt;build&gt;
          &lt;plugins&gt;
          &lt;dependency&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
                  &lt;version&gt;0.13.0&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;generate&lt;/goal&gt;
                          &lt;/goals&gt;
                          &lt;configuration&gt;
                              &lt;extension&gt;true&lt;/extension&gt;
                              &lt;episodes&gt;
                                  &lt;episode&gt;
                                      &lt;groupId&gt;com.bar.foo&lt;/groupId&gt;
                                      &lt;artifactId&gt;schema-b&lt;/artifactId&gt;
                                  &lt;/episode&gt;
                              &lt;/episodes&gt;
                              &lt;catalog&gt;src/main/resources/catalog.cat&lt;/catalog&gt;
                              &lt;schemas&gt;
                                  &lt;schema&gt;
  
                                      &lt;fileset&gt;
                                          &lt;directory&gt;${basedir}/src/main/schemas&lt;/directory&gt;
                                          &lt;includes&gt;
                                              &lt;include&gt;A.xsd&lt;/include&gt;
                                              &lt;include&gt;...&lt;/include&gt;
                                              &lt;include&gt;...&lt;/include&gt;
                                          &lt;/includes&gt;
                                      &lt;/fileset&gt;
                                  &lt;/schema&gt;
                              &lt;/schemas&gt;
                              &lt;bindingDirectory&gt;${basedir}/src/main/schemas&lt;/bindingDirectory&gt;
                              &lt;bindingIncludes&gt;
                                  &lt;include&gt;*.xjb&lt;/include&gt;
                              &lt;/bindingIncludes&gt;
                              &lt;args&gt;
                                  &lt;arg&gt;-Xannotate&lt;/arg&gt;
                              &lt;/args&gt;
                              &lt;plugins&gt;
                                  &lt;plugin&gt;
                                      &lt;groupId&gt;org.jvnet.jaxb2_commons&lt;/groupId&gt;
                                      &lt;artifactId&gt;jaxb2-basics&lt;/artifactId&gt;
                                      &lt;version&gt;0.6.0&lt;/version&gt;
                                  &lt;/plugin&gt;
                                  &lt;plugin&gt;
                                      &lt;groupId&gt;org.jvnet.jaxb2_commons&lt;/groupId&gt;
                                      &lt;artifactId&gt;jaxb2-basics-annotate&lt;/artifactId&gt;
                                      &lt;version&gt;0.6.0&lt;/version&gt;
                                  &lt;/plugin&gt;
                              &lt;/plugins&gt;
                          &lt;/configuration&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>
  
  <p>Here is the catalog file:</p>
  
  <pre><code>PUBLIC "http://com.test.schema/common/Context" "maven:com.bar.foo:schema-a:jar::1.2!"
  </code></pre>
  
  <p>There is some configuration in the xjb file to make sure that XmlRootElement is written into some generated classes:</p>
  
  <pre><code>&lt;jxb:bindings xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
  jxb:version="2.1" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
  xmlns:annox="http://annox.dev.java.net" extensionBindingPrefixes="xjc"&gt;
  &lt;jxb:globalBindings&gt;
      &lt;xjc:simple /&gt;
  &lt;/jxb:globalBindings&gt;   
  &lt;jxb:bindings
      schemaLocation="A.xsd"&gt;
      &lt;jxb:bindings node="//xsd:complexType[@name='ADataType']"&gt;
          &lt;jxb:class name="AData" /&gt;
          &lt;annox:annotate&gt;
              &lt;annox:annotate annox:class="javax.xml.bind.annotation.XmlRootElement"
                  name="AData" /&gt;
          &lt;/annox:annotate&gt;
      &lt;/jxb:bindings&gt;
  &lt;/jxb:bindings&gt;
  </code></pre>
  
  <p></p>
  
  <p>Inspite of providing the episode to the xjc execution and the location of the schema for B.xsd in the catalog file, the classes for B.xsd is getting generated. </p>
  
  <p>The issue is that the maven artifact referred to by the catalog file is not being picked up. I see the following error in the maven build logs:</p>
  
  <pre><code>Malformed URL on system identifier: maven:com.bar.foo:schema-b:jar::1.2!
  PUBLIC: http://com.test.schema/common/Context
  maven:com.bar.foo:schema-a:jar::1.2!
  </code></pre>
  
  <p>Can anyone help tell me why am I hitting this malformed URL error for the artifact that contains B.xsd? Any help will be really appreciated. </p>