Permalink
Browse files

AVRO-983. maven-avro-plugin: Allow maven schema compiler to support e…

…xternal reference in an another avro schema file.

git-svn-id: https://svn.apache.org/repos/asf/avro/trunk@1407418 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 9e5e046 commit f261733c575fbb57ced1f11e8af69ec88b573b8a Thomas White committed Nov 9, 2012
View
3 CHANGES.txt
@@ -20,6 +20,9 @@ Trunk (not yet released)
AVRO-1169. Java: Reduce memory footprint of resolver.
(Hernan Otero via cutting)
+ AVRO-983. maven-avro-plugin: Allow maven schema compiler to support
+ external reference in an another avro schema file (tomwhite)
+
BUG FIXES
AVRO-1171. Java: Don't call configure() twice on mappers & reducers.
View
5 lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/AbstractAvroMojo.java
@@ -20,6 +20,7 @@
import java.io.File;
import java.io.IOException;
+import java.util.Arrays;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
@@ -136,7 +137,9 @@ public void execute() throws MojoExecutionException {
for (String exclude : excludes) {
fs.addExclude(exclude);
}
- return fileSetManager.getIncludedFiles(fs);
+ String[] files = fileSetManager.getIncludedFiles(fs);
+ Arrays.sort(files);
+ return files;
}
private void compileFiles(String[] files, File sourceDir, File outDir) throws MojoExecutionException {
View
3 lang/java/maven-plugin/src/main/java/org/apache/avro/mojo/SchemaMojo.java
@@ -51,10 +51,11 @@
*/
private String[] testIncludes = new String[] { "**/*.avsc" };
+ private Schema.Parser parser = new Schema.Parser();
+
@Override
protected void doCompile(String filename, File sourceDirectory, File outputDirectory) throws IOException {
File src = new File(sourceDirectory, filename);
- Schema.Parser parser = new Schema.Parser();
Schema schema = parser.parse(src);
SpecificCompiler compiler = new SpecificCompiler(schema);
compiler.setTemplateDir(templateDirectory);

0 comments on commit f261733

Please sign in to comment.