Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

groovyc ant task fails with fork="true"

Tags:

groovy

ant

When I run groovyc without the fork option, it works fine. But with fork="true" it fails with an error message:

Error: Could not find or load main class org.codehaus.groovy.ant.FileSystemCompilerFacade 

What is wrong here?

Ant task:

<taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="test.path" />
<groovyc fork="true" srcdir="../myproject/src-test" destdir="${build.test.dir}">
   <javac debug="true" source="1.7" target="1.7" >
      <compilerarg value="-XX:-UseSplitVerifier"/>
   </javac>
</groovyc>

EDIT: test.path contains a groovy jar: (...):/home/pkalinow/(..)/groovy-all-1.8.6.jar:(...)

like image 859
pkalinow Avatar asked Oct 15 '14 09:10

pkalinow


1 Answers

The classpathref="test.path" must be specified in both <taskdef> and <groovyc> invocations when groovyc is forked.

I cannot find any confirmation in the documentation, but it seems, that only non-forking groovyc is inheriting classpath from taskdef.

like image 58
Maciej Małycha Avatar answered Nov 10 '22 05:11

Maciej Małycha