Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catalogs cannot be loaded via resource: URL #58

Open
sewe opened this issue Aug 3, 2020 · 1 comment
Open

Catalogs cannot be loaded via resource: URL #58

sewe opened this issue Aug 3, 2020 · 1 comment

Comments

@sewe
Copy link

sewe commented Aug 3, 2020

The FAQ state the following:

The plugin attempts to resolve resources through the class loader automatically. Alternatively, you can enforce using the class loader, if you specify your resource with an URI like "resource:org/foo/stylesheet.xsl".

Unfortunately, that is only true to stylesheets or schemas, not for catalog files. (To test, simply change mojo-1438-validate’s pom.xml: <catalog>resource:src/main/xml/catalog.xml</catalog>)

This prevents the following use case:

  1. Bundle your schemas or stylesheets along with a catalog into a resource JAR
  2. Refer to the schemas only via their <publicId> during plug-in <configuration>
  3. Moreover, any schema imports can again only use their xs:import/@namespace; no xs:import/@schemaLocation with a Maven-specific resources: scheme is necessary, as the catalog takes care of the mapping.

In other words, the schemas are completely generic. Any Maven-specifics are localized in the catalog.xml that is shared along-side the schemas.

@jochenw
Copy link
Member

jochenw commented Feb 17, 2021

Just a hint: Unless the current directory is in your class path (unlikely for a Maven project), then src/main/xml/catalog.xml is an invalid URI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants