Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0-JSR-1
-
None
-
None
Description
The groovyc Ant task doesn't work in a Maven build, like it used to in the past. The following snippet used to work in older betas, and that's roughly the same thing we use in an Ant build, but under Maven, it complains that it cannot even find groovy.lang.Script or java.lang.Object.
There must be some obscure classpath/classloader issue.
<ant:taskdef name="groovyc"
classname="org.codehaus.groovy.ant.Groovyc"
classpathref="groovyc.classpath"/>
<ant:groovyc destdir="${basedir}/target/classes"
srcdir="${basedir}/main/groovy"
listfiles="true">
<ant:classpath>
<ant:path refid="maven.dependency.classpath"/>
<ant:pathelement path="${maven.build.dest}"/>
</ant:classpath>
</ant:groovyc>
Instead of that, we have to call the java class directly, which is kinda lame, like so:
<java classname="org.codehaus.groovy.ant.Groovyc" fork="yes" failsonerror="true">
<classpath refid="groovyc.classpath"/>
<arg value="${basedir}/target/classes"/>
<arg value="${basedir}/main/groovy"/>
<arg value="true"/>
</java>
James, if you could have a look at it, since you're our Maven expert, that'd be wonderful