On 6/18/2010 4:50 PM, Philip Ogren wrote:
> Hi,
>
> We have been using a snippet for our pom.xml file pretty much exactly
> like the one below to run JCasGen on our type system descriptor before
> compilation.  When I switched to 2.3.0 this doesn't work anymore.  For
> example, when I run "mvn test", JCasGen will generate the files but
> then maven just exits without an error message and without running the
> tests.  If I remove this block of xml from the pom, then everything
> works fine.
>
> Any thoughts about how I would go about fixing this?

I think some more diagnostic info is needed, on why maven exits after
running this.  Try running maven with the -X parameter (turns on
debugging output) and see if something prints that would explain why
maven is exiting.

-Marshall

> Or, does anyone have another snippet of xml I could insert into my
> pom.xml to get the same behavior?
>
> Thanks,
> Philip
>
> On 7/6/2009 7:58 AM, Ramon Ziai wrote:
>> Hi,
>>
>> just as a follow-up to this, I found a solution to this that works for
>> me. Here's the relevant POM snippet, in the hope that it will be useful
>> for others:
>>
>> [...]
>> <plugin>
>>     <groupId>org.codehaus.mojo</groupId>
>>     <artifactId>exec-maven-plugin</artifactId>
>>     <version>1.1</version>
>>     <executions>
>>         <execution>
>>             <phase>validate</phase>
>>             <goals>
>>                 <goal>java</goal>
>>             </goals>
>>         </execution>
>>     </executions>
>>     <configuration>
>>         <mainClass>org.apache.uima.tools.jcasgen.Jg</mainClass>
>>         <arguments>
>>             <argument>-jcasgeninput</argument>
>>             <argument>desc/yourTypeSystem.xml</argument>
>>                          <argument>-jcasgenoutput</argument>
>>             <argument>src/main/java</argument>
>>         </arguments>
>>     </configuration>
>> </plugin>
>> [...]
>>
>> This will run JCasGen prior to the compile phase, ensuring that build
>> dependencies are satisfied. JCasGen is run without the merge capability,
>> so manual changes to the generated Java files will be lost.
>>
>> Best,
>> Ramon
>>
>> Александър Л. Димитров schrieb:
>>   
>>> Hello,
>>>
>>> I'm currently working on a distributed project involving UIMA. At
>>> this stage,
>>> sometimes modifications to the UIMA descriptor files are absolutely
>>> necessary
>>> and, unfortunately, this confuses our VCS. Whenever JCasGen is run
>>> from within
>>> Eclipse or similar, it updates *all* generated class files, which
>>> leads the VCS
>>> to treating them as new commits. The problem here is, when editing the
>>> descriptors on different branches, while the merging of the
>>> descriptor files
>>> goes well most of the time, the merging of the class files fails
>>> most of the
>>> time. This leaves the merger with several dozen conflicts.
>>>
>>> The current policy is to then just delete those files and run
>>> JCasGen on the
>>> merged branch. Of course, the actual problem here is, that one
>>> shouldn't really
>>> track those files in the first place.
>>>
>>> But the matter is slightly more delicate. After checking out the
>>> project from
>>> version control, the project should be readily compilable, without
>>> further
>>> setup. That's why we're using Maven to fetch all dependencies and
>>> automate the
>>> build process. Without having these files in source control, they
>>> have to be
>>> generated first.
>>>
>>> So the real question is: is there any way to run a JCasGen from
>>> within the Maven
>>> build? Probably a plugin? Of course, one could just spawn a process
>>> to call
>>> org.apache.uima.tools.jcasgen.Jg, but I wanted to ask if such a
>>> thing already
>>> existed.
>>>
>>> Thanks,
>>> Aleks
>>>      
>>    
>
>

Reply via email to