On Aug 10, 2010, at 10:04 AM, Bergmann Manfred wrote:

> Hi.
> 
> The following task:
> task myjar(dependsOn:enhance) << {
>   def destFile = "build/libs/${project.name}-${version}-myjar.jar"
>   ant.delete(file:destFile)
>   ant.mkdir(dir:'build/libs')
>   ant.jar(destfile:destFile) {
>       manifest() {
>           attribute(name:"Specification-Title", value:"${project.name}")
>           attribute(name:"Specification-Version", value:"${version}")
>           attribute(name:"Specification-Vendor", value:"${vendor}")
>           attribute(name:"Implementation-Title", value:"${project.name}")
>           attribute(name:"Implementation-Version", value:"${version}")
>           attribute(name:"Implementation-Vendor", value:"${vendor}")
>           attribute(name:"Main-Class", value:"de.mabe.xea.ui.XeaUI")
>       }
>   }
> }
> 
> 
> Produces the following error:
> * What went wrong:
> Execution failed for task ':myjar'.
> Cause: jar doesn't support the nested "attribute" element.
> 


manifest implements an attributes method (note the plural) that takes a map.
Like:
  ant.jar(destfile:destFile) {
      manifest() {
          attributes (
             'Specification-Title': project.name",
             'Specification-Version':version
          )
      }
  }
--
Steve Appling
Automated Logic Research Team





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to