Skip to content

Commit

Permalink
Issue #10: Update archetype for UIMA 3 OSGi combination
Browse files Browse the repository at this point in the history
- build refactoring including jcasgen
- removed second it project
  • Loading branch information
pkluegl committed Sep 16, 2021
1 parent 9a904b4 commit f3014b1
Show file tree
Hide file tree
Showing 17 changed files with 12,308 additions and 668 deletions.
103 changes: 50 additions & 53 deletions src/main/resources/archetype-resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@
<artifactId>numeric-value-typesystem</artifactId>
<version>${core-typesystems-version}</version>
</dependency>
<dependency>
<groupId>de.averbis.textanalysis</groupId>
<artifactId>named-entity-typesystem</artifactId>
<version>${core-typesystems-version}</version>
</dependency>
<dependency>
<groupId>de.averbis.textanalysis</groupId>
<artifactId>text-typesystem</artifactId>
<version>${core-typesystems-version}</version>
</dependency>
<dependency>
<groupId>de.averbis.textanalysis</groupId>
<artifactId>neural-typesystem</artifactId>
<version>${core-typesystems-version}</version>
</dependency>
<dependency>
<groupId>de.averbis.textanalysis</groupId>
<artifactId>evaluation-typesystem</artifactId>
<version>${core-typesystems-version}</version>
</dependency>


<dependency>
<groupId>de.averbis.textanalysis</groupId>
Expand Down Expand Up @@ -190,35 +211,14 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<id>generate-ruta-template</id>
<phase>process-classes</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>${package}.GenerateConfiguredDescriptorTemplate</mainClass>
<classpathScope>test</classpathScope>
<arguments>
<argument>${project.build.directory}/generated-sources/ruta/descriptor/GeneratedBasicEngine.xml</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.uima</groupId>
<artifactId>ruta-maven-plugin</artifactId>
<version>${ruta-version}</version>
<executions>
<execution>
<id>descriptors</id>
<phase>process-classes</phase>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
Expand All @@ -229,7 +229,7 @@
<include>**/*.ruta</include>
</includes>
</scriptFiles>
<analysisEngineTemplate>${project.build.directory}/generated-sources/ruta/descriptor/GeneratedBasicEngine.xml</analysisEngineTemplate>
<analysisEngineTemplate>${basedir}/src/main/resources/descriptor/GeneratedBasicEngine.xml</analysisEngineTemplate>
<typeSystemOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</typeSystemOutputDirectory>
<analysisEngineOutputDirectory>${project.build.directory}/generated-sources/ruta/descriptor</analysisEngineOutputDirectory>
<analysisEngineSuffix>RutaAnnotator</analysisEngineSuffix>
Expand All @@ -248,6 +248,31 @@
</execution>
</executions>
</plugin>
<!-- Generate Java classes for defined types -->
<plugin>
<groupId>org.apache.uima</groupId>
<artifactId>jcasgen-maven-plugin</artifactId>
<version>${uima-version}</version>
<executions>
<execution>
<id>generate-jcas-classes</id>
<phase>generate-sources</phase>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<typeSystemIncludes>
<typeSystemInclude>target/generated-sources/ruta/descriptor/${packageInPathFormat}/${rutaScriptName}RutaTypeSystem.xml</typeSystemInclude>
</typeSystemIncludes>
<typeSystemExcludes>
<typeSystemExclude>/**/BasicTypeSystem.xml</typeSystemExclude>
<typeSystemExclude>/**/InternalTypeSystem.xml</typeSystemExclude>
</typeSystemExcludes>
<limitToProject>true</limitToProject>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down Expand Up @@ -295,6 +320,7 @@
</execution>
</executions>
</plugin>
<!-- Include dependencies in runtime scope as libraries -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
Expand All @@ -313,13 +339,13 @@
</execution>
</executions>
</plugin>
<!-- Assembles the PEAR package -->
<plugin>
<groupId>org.apache.uima</groupId>
<artifactId>PearPackagingMavenPlugin</artifactId>
<version>${uima-version}</version>
<extensions>true</extensions>
<executions>
<!-- Assembles the PEAR package -->
<execution>
<phase>package</phase>
<configuration>
Expand All @@ -334,35 +360,6 @@
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<versionRange>[1.6.0,)</versionRange>
<goals>
<goal>java</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,17 @@
import org.apache.uima.ruta.engine.RutaEngine;
import org.xml.sax.SAXException;

/**
* Helper class for manually generating a preconfigured descriptor template for the generated Ruta
* analysis engine descriptors
*
*/
public class GenerateConfiguredDescriptorTemplate {

public static void main(String[] args) throws ResourceInitializationException,
FileNotFoundException, SAXException, IOException {

File outputFile = new File(args[0]);
File outputFile = new File("src/main/resources/descriptor/GeneratedBasicEngine.xml");
outputFile.getParentFile().mkdirs();

AnalysisEngineDescription description = AnalysisEngineFactory
Expand Down
Loading

0 comments on commit f3014b1

Please sign in to comment.