We have a use case for importing idl files as classpath resources (it makes possible to re-use idls in downstream artifacts if all imports use classpath resources as opposed to a file-based reference). To enable this, the imports in the same artifacts should be able to use classpath resources for other avro files in the same source structure.
The proposed approach is to just add the source directory of avro files to the classpath. The avro resources would then follow the directory structure. This means that if someone configures the avro-maven-plugin with a source directory like this:
And the idl files live under project.basedir/src/main/resources/avro, the imports could be referencing other avro files like this:
Things open for discussion:
- Any documentation required to make this clear to end-users?
- Should I add the resources directories to the classpath as well?