views:

294

answers:

2

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?

A: 

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

Chris Dail
A: 

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.

Eyvind