avro-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chau, Victor" <vic...@x.com>
Subject RE: Importing in avdl from classpath of project
Date Thu, 08 Dec 2011 00:33:03 GMT
Hi Scott,

I created JIRA issue AVRO-971.


From: Scott Carey [mailto:scott@richrelevance.com] On Behalf Of Scott Carey
Sent: Wednesday, December 07, 2011 10:50 AM
To: user@avro.apache.org
Subject: Re: Importing in avdl from classpath of project

I think that at minimum, it would be useful to have an option to 'also look in the classpath'
in the maven plugin, and have the option to do so in general with the IDL compiler.   I would
gladly review the patch in a JIRA.

-Scott

On 12/7/11 10:13 AM, "Chau, Victor" <victor@x.com<mailto:victor@x.com>> wrote:

Hello,

I am trying to address a shortcoming of the way that the import feature works in IDL.  Currently,
it looks like the only option is to place the file being imported inside the same directory
as that of the importing avdl.

In our setup, we have avdl's that are spread among several maven projects that are owned by
different teams.  I would like to be able to just create a dependency on another jar that
contains the avdl I am want to import and have Avro be smart enough to look for it in the
classpath of the project containing the avdl.

The main problem is to make all of this work with the avro-maven-plugin.  The plugin's runtime
classpath is not the same as that of the maven project's classpath.  Through the magic of
Stackoverflow, I figured out how to get the project's classpath and construct a new classloader
and pass it to the Idl compiler for it to lookup the file if it is not available in the local
directory.

Is this a feature that people think would be useful?  Essentially, the IDL syntax would not
change but the behavior is:


1.       If imported file is available locally (in the current input path), use it

2.       Else look for it on the project's classpath.

If so, I have a working patch that needs some cleanup but I can submit it as a feature request
in JIRA.

Mime
View raw message