Hi Peter,
this helped a little bit, but it is still not running. I had to add the resources section
to the pom.
...
<build>
<resources>
<resource>
<directory>src/main/ruta</directory>
</resource>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-sources/ruta/descriptor</directory>
</resource>
<resource>
<directory>${project.build.directory}/generated-sources/ruta/resources</directory>
</resource>
</resources>
<plugins>
...
<plugin>
<groupId>org.apache.uima</groupId>
<artifactId>ruta-maven-plugin</artifactId>
<version>2.3.0</version>
<executions>
<execution>
<id>descriptors</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
</configuration>
</execution>
<execution>
<id>twl</id>
<phase>generate-resources</phase>
<goals>
<goal>twl</goal>
</goals>
<configuration>
<inputFiles>
<directory>${basedir}/src/main/resources/</directory>
<includes>
<include>*.txt</include>
</includes>
</inputFiles>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
DateEngine.xml, DateTypeSystem.xml, and Date.ruta as well as the twl file are generated and
packaged in the jar file.
But the CPE throws following exception:
...
Caused by: org.apache.uima.resource.ResourceConfigurationException: Initialization of CAS
Processor with name "aggregate" failed.
at org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1102)
at org.apache.uima.collection.impl.cpm.container.CPEFactory.getCasProcessors(CPEFactory.java:548)
at org.apache.uima.collection.impl.cpm.BaseCPMImpl.init(BaseCPMImpl.java:253)
at org.apache.uima.collection.impl.cpm.BaseCPMImpl.<init>(BaseCPMImpl.java:127)
at org.apache.uima.collection.impl.CollectionProcessingEngine_impl.initialize(CollectionProcessingEngine_impl.java:73)
... 5 more
Caused by: org.apache.uima.resource.ResourceInitializationException: Import failed. Could
not read from URL file:/tmp/DateTypeSystem.xml. (Descriptor: file:/tmp/desc6822394770076871542.xml)
at org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl.initialize(AggregateAnalysisEngine_impl.java:162)
at org.apache.uima.impl.AnalysisEngineFactory_impl.produceResource(AnalysisEngineFactory_impl.java:94)
at org.apache.uima.impl.CompositeResourceFactory_impl.produceResource(CompositeResourceFactory_impl.java:62)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:279)
at org.apache.uima.UIMAFramework.produceResource(UIMAFramework.java:331)
at org.apache.uima.UIMAFramework.produceAnalysisEngine(UIMAFramework.java:448)
at org.apache.uima.collection.impl.cpm.container.CPEFactory.produceIntegratedCasProcessor(CPEFactory.java:1086)
... 9 more
...
Do you have any suggestions?
Regards,
Armin
-----Ursprüngliche Nachricht-----
Von: Peter Klügl [mailto:peter.kluegl@averbis.com]
Gesendet: Montag, 5. Oktober 2015 17:56
An: user@uima.apache.org
Betreff: Re: Ruta Maven Plugin
Hi,
there is no step-by-step description yet, only the part of the
documentation here:
https://uima.apache.org/d/ruta-current/tools.ruta.book.html#ugr.tools.ruta.maven
There are some examples of maven configurations:
https://svn.apache.org/repos/asf/uima/ruta/trunk/example-projects/ruta-maven-example
https://svn.apache.org/repos/asf/uima/ruta/trunk/ruta-maven-plugin/src/it/multimodule
https://svn.apache.org/repos/asf/uima/ruta/trunk/ruta-maven-plugin/src/it/importByName
My best guess without knowing your maven configuration/pom is that the
phase of the ruta-maven-plugin needs to be changed. Did you use:
<id>descriptors</id>
<phase>process-classes</phase>
<goals>
<goal>generate</goal>
</goals>
if yes, try:
<id>descriptors</id>
<phase>generate-resources</phase>
<goals>
<goal>generate</goal>
</goals>
If that solves the problem, then please accept my apologies... I will
adapt the documentation. There was actually a reason why I used
process-classes in the first place...
Best,
Peter
Am 05.10.2015 um 17:20 schrieb Armin.Wegner@bka.bund.de:
> Hi,
>
> how ist ruta-maven-plugin supposed to be used? Is there a detailed step by step description?
>
> I've created a new empty maven project, added a script in the source folder src/main/ruta
and a text file containing a list of words to src/main/resources.
> mvn package builds a ...Engine.xml and a ...TypeSystem.xml in target/generated-sources/ruta/descriptor
and a ...twl file in target/ruta/resources. But none of them is packaged in the jar file.
>
> I intend to add that jar file as a maven dependency and create the analysis engine by
AnalysisEngineFactory.createEngineDescription(<engine name>). Did I miss something?
>
> Regards,
> Armin
>
|