- Making a Groovy script executable on Linux/OS X
- Out of memory
- Verbose dependency resolving
- Flush caches
- Separate Groovy Grape Cache from Maven Cache
- Groovy 2.3.0 aka “JCas type used in Java code, but was not declared in the XML type descriptor”
- Using SNAPSHOT versions
Making a Groovy script executable on Linux/OS X
To make a Groovy script executable on Linux or OS X, add the following line as the very first line in the script:
Then make the file executable using the
chmod command, e.g.
Out of memory
If a script complains about not having enough heap, try the command
and then run the script again.
Verbose dependency resolving
Normally, grape resolves dependencies quietly. If a script has many dependencies, that can mean the script may be running for a long time without any visible output on screen, looking like it is hanging. What it really does is downloading the dependencies. To enable verbose output during the dependency resolving phase, set JAVA_OPTS:
The scripts download required models and libraries automatically. Sometimes it may be necessary to flush the cache folders. There are two cache folders that you can clear to force re-downloading the dependencies:
~/.groovy/grapes- dependencies referenced from the Groovy scripts are stored here
~/.ivy2/cache- models and resources dynamically downloaded by DKPro Core components
If you use Maven for software development, we recommend that you separate the caches (see below). If you did not separate the Groovy cache from the Maven cache, you might also want to consider deleting
Separate Groovy Grape Cache from Maven Cache
On some systems, Groovy per default re-uses artifacts that have already been downloaded by Maven. To make sure the Groovy Grape cache is fully separate from the Maven cache, create a file called
grapeConfig.xml in your
~\.groovy folder with this content
Then flush the cache by deleting the folder
~/.groovy/grapes. Mind that the next time you run a Groovy script, it will take some more time, because the cache needs to be repopulated.
Groovy 2.3.0 aka “JCas type used in Java code, but was not declared in the XML type descriptor”
When running our scripts within Groovy 2.3.0, uimaFIT’s automatic type detection mechanism does not work. This leads to an error message like this:
This problem does not occur with Groovy 2.1.x, 2.2.x or 2.3.1 and higher.
Thanks to Evan for reporting this problem.
Using SNAPSHOT versions
To use SNAPSHOT versions of DKPro Core, add the following line before the first
Then change the versions of all DKPro Core components to the SNAPSHOT version that you wish to use. It is strongly recommended not to mix versions!