0
當我執行導入的螞蟻任務,我得到一個異常:搖籃不能使用ant可選的(例如ScriptRunner腳本任務)
java.lang.ClassNotFoundException: org.apache.tools.ant.util.optional.ScriptRunner
我知道我使用腳本在很多地方在我的任務。我使用它們像這樣:
<script manager="bsf" language="beanshell" classpath="${bshJar}"><![CDATA[
我猜我莫名其妙必須添加一個依賴於螞蟻的Apache-BSF罐子。我試過
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.apache.ant:ant-apache-bsf:+'
}
}
// Confirm the classpath contains optional jar.
// The jar contains the required class.
buildscript.configurations.classpath.each { println it }
def sc = new org.apache.tools.ant.util.optional.ScriptRunner();
println "sure we are able to create a script runner object: $sc"
ant.importBuild "build.xml"
沒有成功。 Gradle用戶指南中有一篇文章,標題爲42.9 Ant optional dependencies。不幸的是,我從這篇文章中唯一能理解的是我的解決方案不起作用。這裏給出的例子沒有幫助。
我該如何使用我的ant腳本任務?