Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-846

The groovyc Ant task doesn't work in Maven

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-1
    • 1.0-JSR-2
    • 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

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            guillaume Guillaume Sauthier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: