Skip to content

Resolve Module Imports using classpath: scheme #178

@MarcoPauls

Description

@MarcoPauls

See also #152

Situation

  • We are developing Apache Camel based transformations using XQuery for xml to xml transformation.
    Project layout ist standard maven layout with java and resources folder.
    • XQuery files are located under the resources folder.
  • Applications packaged as single jar. XQuery files are packaged within the jar.
  • Apache Camel uses Saxon HE as XQuery processor

Module imports are made as follows

import module namespace lib = "urn:mycompany:xquery:lib" at "classpath:path/to/lib.xquery";

where path/to is the structure beyond the resources folder.

During runtime the modules are picked up by Apache Camel's org.apache.camel.component.xquery.XQueryModuleURIResolver which can handle the classpath: scheme.

During development time the modules cannot be located by the plugin. Usage of functions from an imported module are displayed as errors.

You can work around this issue by replacing classpath: imports with relative file path imports

Complication

  • You have only partial editing and validation support during development
  • or have to use different import directives for development and deployment

Request

Allow and resolve classpath: imports.


I would assume that the plugin has access to the project meta data (I do not know the API) and hence know project nature and project layout so that the module loader could translate classpath to "root of ressources folder" and so be able to resolve the imported modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions