Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1384

avro-maven-plugin: Can't import idl files as classpath resources from the same set of sources

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.5
    • Fix Version/s: 1.7.6
    • Component/s: java
    • Labels:
      None

      Description

      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:

      <sourceDirectory>${project.basedir}/src/main/resources</sourceDirectory>
      

      And the idl files live under project.basedir/src/main/resources/avro, the imports could be referencing other avro files like this:

      import idl "avro/otherSchema.avdl";
      

      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?

        Attachments

        1. AVRO-1384-rev1.patch
          7 kB
          Alexandre Normand
        2. AVRO-1384.patch
          7 kB
          Alexandre Normand
        3. AVRO-1384.patch
          6 kB
          Doug Cutting

          Activity

            People

            • Assignee:
              alexandre.normand Alexandre Normand
              Reporter:
              alexandre.normand Alexandre Normand
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: