0

I'm not 100% sure that e.g. version 1.7.7 of Avro can read files produced by 1.9.2 or 1.8.2. So I'd rather keep somewhere in meta information the version of avro that was used when creating a file.

But I don't see how it is possible, without tweaking build files and creating some kind of resource (it's pretty simple in gradle).

Vlad Patryshev
  • 1,379
  • 1
  • 10
  • 16

1 Answers1

0

As you can see in Get jar version in runtime, version can be retrieved, at least when it's provided.

So, in this specific case, the following line:

(new org.apache.avro.Schema.Parser).getClass.getPackage.getImplementationVersion

Returns a version string; in my specific case it is "1.7.7".

Vlad Patryshev
  • 1,379
  • 1
  • 10
  • 16