I have a maven project A with an /xsd/a.xsd in it's classpath. I also have the project B with an /xsd/b.xsd that refers to /xsd/a.xsd through a catalog entry. The catalog entry looks like this:
PUBLIC "http://foo.org/a" "maven:org.foo:a:jar::!/xsd/a.xsd"
Note the maven protocol in the url. The catalog is used by the org.jvnet.jaxb2.maven2:maven-jaxb22-plugin to generate the JAXB annotated Java classes with episodes from dependencies.
Everything is good so far.
Now I would like to edit /xsd/b.xsd in Eclipse. Eclipse report a warning on:
<xsd:import namespace="http://foo.org/a" />
as it cannot find the /xsd/a.xsd without a schemaLocation attribute. Eclipse does not recognize the catalog entry defined above.
The workaround found is to add a catalog entry in Eclipse / Window / Preferences / XML / XML Catalog:
PUBLIC "http://foo.org/a" "jar:file:/home/alain/maven/repository/org/foo/a/1.0-SNAPSHOT/a-1.0-SNAPSHOT.jar!/xsd/a.xsd"
Note the reference to my local repository (maven is a link to .m2) and to a specific version of the dependent project a.
Anyone having faced this issue and found a better workaround?
.m2
directory because of the dot. – Incommunicable