궁극적으로 그것을하는 방법을 알아 냈습니다 ... 그리고 그것은 예쁘지 않습니다! 비슷한 상황에 처한 다른 사람들을 위해 아래의 코드를 작성하십시오.
CpeDescription cpeDesc = UIMAFramework.getXMLParser().parseCpeDescription(new XMLInputSource(cpeFile));
File rootFolder = new File(cpeDesc.getSourceUrl().getFile()).getParentFile();
ArrayList<TypeSystemDescription> typeSystems = new ArrayList<>();
for(CpeCollectionReader collReader : cpeDesc.getAllCollectionCollectionReaders()){
File descFile = new File(rootFolder + System.getProperty("file.separator") + collReader.getDescriptor().getImport().getLocation());
CollectionReaderDescription crd = UIMAFramework.getXMLParser().parseCollectionReaderDescription(new XMLInputSource(descFile));
TypeSystemDescription typeSystem = crd.getCollectionReaderMetaData().getTypeSystem();
typeSystem.resolveImports();
typeSystems.add(typeSystem);
}
for(CpeCasProcessor casProcessor : cpeDesc.getCpeCasProcessors().getAllCpeCasProcessors()){
File descFile = new File(rootFolder + System.getProperty("file.separator") + casProcessor.getCpeComponentDescriptor().getImport().getLocation());
AnalysisEngineDescription aed = UIMAFramework.getXMLParser().parseAnalysisEngineDescription(new XMLInputSource(descFile));
TypeSystemDescription typeSystem = aed.getAnalysisEngineMetaData().getTypeSystem();
typeSystem.resolveImports();
typeSystems.add(typeSystem);
}
TypeSystemDescription mergedTypeSystem = CasCreationUtils.mergeTypeSystems(typeSystems);
CPE 디스크립터에는 Imports 만 포함되며 CPE 디스크립터에는 포함되지 않습니다.