uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philip Ogren <phi...@ogren.info>
Subject solution for generating type system files with JCasGen using Maven [was Re: maven src directory for generated code]
Date Thu, 21 Oct 2010 16:49:33 GMT
Here is the solution that I have gathered.  Thanks again for the help!  
I realize this is mostly repeated from previous posts from this past 
summer - but I think this is a bit better now...

Here is the xml snippet for generating the type system files:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.uimafit.util.JCasGenPomFriendly</mainClass>
<arguments>
<argument>file:${project.basedir}/src/main/resources/.../TypeSystem.xml
</argument>
<argument>${project.build.directory}/generated-sources/jcasgen</argument>
</arguments>
</configuration>
</plugin>

This assumes you have uimaFIT as a dependency which can be added with 
the following:

<dependency>
<groupId>org.uimafit</groupId>
<artifactId>uimafit</artifactId>
<version>1.0.0</version>
<optional>false</optional>
</dependency>

Here is the xml snippet for adding 
${project.build.directory}/generated-sources/jcasgen as a source directory:

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>add-source</id>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${project.build.directory}/generated-sources/jcasgen</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

Finally, for eclipse users here is a hint from Marshall:  Using 
m2eclipse Eclipse plugin for maven - by default it will "miss" these 
generated directories the first time you import a project as a Maven 
project.  However, the recovery is simple, and only needs doing once: 
right click the project and select Maven -> update project configuration.


Mime
View raw message