You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Dieter Decavele (JIRA)" <ji...@apache.org> on 2014/01/14 10:12:58 UTC

[jira] [Created] (AVRO-1437) Avro maven plugin: imports element has incorrect documentation or behaviour

Dieter Decavele created AVRO-1437:
-------------------------------------

             Summary: Avro maven plugin: imports element has incorrect documentation or behaviour
                 Key: AVRO-1437
                 URL: https://issues.apache.org/jira/browse/AVRO-1437
             Project: Avro
          Issue Type: Improvement
          Components: java
    Affects Versions: 1.7.5
            Reporter: Dieter Decavele
            Priority: Minor


Problem:
I have an enum an a record both sharing the same namespace and placed in the same directory.

Running the schema goal for the plugin without the imports element just generates the enum java source.


Issue:

The javadoc on the org.apache.avro.mojo.AbstractAvroMojo.imports field states:

"A list of files or directories that should be compiled first thus making them importable by subsequently compiled schemas. Note that imported files should not reference each other."

Adding the import to the directory results in:
Execution default of goal org.apache.avro:avro-maven-plugin:1.7.5:schema failed: Can't redefine: *Name of the record*
The record schema is referencing the enum so I suppose this is an appropriate error.

Adding and empty imports element however works because org.apache.avro.mojo.SchemaMojo.doCompile(String, File, File) does use this field but only checks if it has defined (!= null).  When defined it will reuse the schema parser.


Solution:
Either the documentation should be updated to reflect the behaviour or the behaviour should be altered.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)