public void configure(CAS aCas) throws AnalysisEngineProcessException { try { language = aCas.getDocumentLanguage(); super.configure(); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } }
Properties props = getAggregatedProperties(); String modelLocation = getModelLocation(props); boolean modelLocationChanged = !StringUtils.equals(modelLocation, lastModelLocation); lastModelLocation = modelLocation; if (modelLocationChanged) { log.info("Producing resource from thin air"); loadResource(props); resolved = resolveDependency(props); initialUrl = resolveLocation(modelLocation, loader, null); throw handleResolvingError(re, lastModelLocation, resolved); throw handleResolvingError(e, lastModelLocation, props); if (!equals(initialResourceUrl, initialUrl)) { initialResourceUrl = initialUrl; resourceMetaData = new Properties(); resourceUrl = followRedirects(initialResourceUrl); if (resourceUrl == null) { initialResourceUrl = null; if (modelLocationChanged) { log.info("Producing resource from thin air"); loadResource(props); loadMetadata(); if (initialResourceUrl.equals(resourceUrl)) { log.info("Producing resource from " + resourceUrl);
Properties props = getProperties(); if (props != null) { defaultValues.putAll(props); setDefaultVariants(PropertiesLoaderUtils.loadAllProperties(dvl));
getModelVersionFromMavenPom(groupId, artifactId, contextClass)); String version = parts[3]; List<File> files = resolveWithIvy(groupId, artifactId, version); for (File file : files) { loader.addURL(file.toURI().toURL());
String modelMetaDataLocation = getModelMetaDataLocation(resourceUrl.toString()); URL modelMetaDataUrl = resolveLocation(modelMetaDataLocation, loader, null); modelMetaData = PropertiesLoaderUtils.loadProperties(new UrlResource( String modelMetaDataLocation = getModelMetaDataLocation(lastModelLocation); URL modelMetaDataUrl = resolveLocation(modelMetaDataLocation, loader, null); modelMetaData = PropertiesLoaderUtils.loadProperties(new UrlResource( mergeProperties(resourceMetaData, modelMetaData);
/** * For use in test cases. * @return the location of the model. * @throws IOException * if the language-dependent default variants location is set but cannot be read. */ protected String getModelLocation() throws IOException { return getModelLocation(null); }
protected String getModelLocation(Properties aProperties) throws IOException { Properties props = aProperties; if (props == null) { props = getAggregatedProperties(); } try { return pph.replacePlaceholders(props.getProperty(LOCATION), props); } catch (IllegalArgumentException e) { throw new IllegalStateException("Unable to resolve the model location [" + props.getProperty(LOCATION) + "]: " + e.getMessage() + ". Possibly there is " + "no default model configured for the specified language [" + props.getProperty(LANGUAGE) + "] or the language is set incorrectly."); } }
throws IOException List<URL> urls = getPomUrlsForClass(aModelGroup, aModelArtifact, contextClass);
DependencyResolver modelResolver = getModelResolver(); modelResolver.setSettings(ivySettings); ivySettings.addResolver(modelResolver);