Friday, April 15, 2011

Problems compiling Groovy from source

I am trying to compile the latest Groovy distribution from source, using ant 1.7.1. The process runs along smoothly until "-createEmbeddableJar:", under which it fails saying

BUILD FAILED myHomeDir/groovy-src-1.6.0/groovy-1.6.0/build.xml:582: The <unwar> type doesn't support the nested "globmapper" element.

Build xml from line 582 looks like this:

   <unzip dest="${stagingDirectory}">
        <patternset>
            <!-- no need for the manifest file, we have our own -->
            <exclude name="META-INF/MANIFEST.MF"/>
        </patternset>
        <globmapper from="META-INF/LICENSE.txt" to="META-INF/CLI-LICENSE.txt"/>
        <fileset dir="${runtimeLibDirectory}">
            <include name="commons-cli-*.jar"/>
        </fileset>
    </unzip>

Any ideas as to what is wrong here?

From stackoverflow
  • It looks like the unzip task is not recognizing the 'globmapper'. The docs do say that it supports a nested 'mapper' here: http://ant.apache.org/manual/CoreTasks/unzip.html

    That task may be specifically looking for the mapper element with that name. You could try this which does the same thing but with a mapper parent element.

    <mapper>
      <globmapper from="META-INF/LICENSE.txt" to="META-INF/CLI-LICENSE.txt"/>
    </mapper>
    

    More information on the mappers can be found here: http://ant.apache.org/manual/CoreTypes/mapper.html

  • It turns out that the problem was with ant, which for some reason found an older version of itself with which it tried to compile. Setting CLASSPATH to . resolved the problem.

0 comments:

Post a Comment