ds.setCaseSensitive(true);
getLog().debug("JCasGen: Scanning for descriptors in '" + ds.getBasedir() + "'");
ds.scan();
// Create a merged type system and check if any of the files has a delta
TypeSystemDescription typeSystem = new TypeSystemDescription_impl();
List<Import> imports = new ArrayList<Import>();
boolean contextDelta = false;
for (String descriptorLocation : ds.getIncludedFiles()) {
File descriptorFile = new File(ds.getBasedir(), descriptorLocation);
this.getLog().info("JCasGen: Found descriptor '" + descriptorFile.getAbsolutePath() + "'");
Import imp = new Import_impl();
// setLocation takes a string which must be a URL
// https://issues.apache.org/jira/browse/UIMA-2983
URL url;
try {
url = descriptorFile.toURI().toURL();
} catch (MalformedURLException e) {
throw new RuntimeException(e); // this should never happen for files
}
imp.setLocation(url.toString());
imports.add(imp);
contextDelta |= this.buildContext.hasDelta(new File(ds.getBasedir(), descriptorLocation));
}
Import[] importArray = new Import[imports.size()];
typeSystem.setImports(imports.toArray(importArray));
// Save type system to a file so we can pass it to the Jg
// Do this before resolving the imports
OutputStream typeSystemOs = null;
File typeSystemFile;
try {
typeSystemFile = new File(project.getBuild().getDirectory(), "jcasgen/typesystem.xml");
getLog().debug("JCasGen: Writing master descriptor to in '" + typeSystemFile + "'");
typeSystemFile.getParentFile().mkdirs();
typeSystemOs = new FileOutputStream(typeSystemFile);
typeSystem.toXML(typeSystemOs);
} catch (IOException e) {
throw new MojoExecutionException(e.getMessage(), e.getCause());
} catch (SAXException e) {
throw new MojoExecutionException(e.getMessage(), e.getCause());
} finally {