users@jaxb.java.net

Unnecessary System.err message from org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver

From: John Wu <john.wu_at_gi-de.com>
Date: Mon, 25 Jul 2011 14:59:51 -0400

ClasspathCatalogResolver always emits the following System error messages,
even though the target schema exists in the same dir and the build
eventually succeeded:
                Could not resolve publicId [http://www.test.com/jaxb2],
systemId [A.xsd]
                Could not resolve publicId [null], systemId
[file:/THE_PROJECT_DIR/src/main/resources/META-INF/schema/A.xsd]

Here is the simple scenario:
- A.xsd and B.xsd are both in /src/main/resources/META-INF/schema;
- B.xsd imports A.xsd as follows:
                <xsd:import namespace="http://www.test.com/jaxb2"
schemaLocation="A.xsd" />
- The maven project uses maven-jaxb2-plugin as follows:
        <build>
                <plugins>
                        ... ... ...
                        <plugin>
                                <groupId>org.jvnet.jaxb2.maven2</groupId>
 <artifactId>maven-jaxb2-plugin</artifactId>
                                <version>0.8.0</version>
                                <executions>
                                        <execution>
                                                <id>generate-schema</id>
                                                <goals>
 <goal>generate</goal>
                                                </goals>
                                                <configuration>
                                                        <schemas>
                                                                <schema>
 <fileset>
 <directory>${basedir}/src/main/resources/META-INF/schema</directory>
 </fileset>
                                                                </schema>
                                                        </schemas>

 <catalog>src/main/resources/META-INF/schema/catalog.cat</catalog>
 
<catalogResolver>org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver</catalogResolver>
                                                        </plugins>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>
                </plugins>
        </build>

Just to clarify, ClasspathCatalogResolver works as expected on resolving
schema in the dependent episode. The scenario above is just simplified to
focus on the issue.

John Wu