jar erstellen Ich versuche Ant Build meines Projekts mit groovy erstellen. Ich bekomme "Caught:: jar unterstützt nicht den" destdir "Attribut" Fehler beim Versuch, jar mit AntBuilder in groovy zu erstellen.Kann nicht mit Hilfe von AntBuilder in groovy
Meine groovy Datei ist als
build.groovy
Paket folgt com.groovy.core.utils
Import groovy.util.AntBuilder
Klasse build {
def ant = new groovy.util.AntBuilder()
def base_dir = "C:/Users/abc/neon/GroovyAntDateUtils/"
def src_dir = base_dir + "src"
def lib_dir = "C:/Jars/groovy-2.4.12/lib"
def build_dir = base_dir + "com/groovy/core/utils"
def dist_dir = base_dir + "dist"
def file_name = "DateUtils"
/*, includeantruntime : "false"*/
static void main(args){
println("hi welcome to groovy");
def b = new build()
b.jar()
//b.run(args)
}
def classpath = ant.path {
fileset(dir: "${lib_dir}"){
include(name: "*.jar")
}
pathelement(path: "${build_dir}")
}
def clean(){
ant.delete(dir : "${build_dir}")
ant.delete(dir : "${dist_dir}")
}
def jar(){
clean()
buildFolder()
ant.mkdir(dir: "${dist_dir}")
ant.jar(destdir: "${dist_dir}/${file_name}.jar", basedir: "${build_dir}")
}
def compile(){
ant.javac(destdir: "${build_dir}", srcdir: "${src_dir}", classpath: "${classpath}")
}
def buildFolder(){
ant.mkdir(dir: "${build_dir}")
compile()
}
}
JDK - 1.8.0_121 ant & ant launcher - 1.9.0 groovy - 2.4.12
Danke! Das war das letzte fehlende Stück und es funktionierte wie Charme :) – user1734698