Gradle can't use ant optional (for example ScriptRunner in script task) -


when execute imported ant task, exception:

java.lang.classnotfoundexception: org.apache.tools.ant.util.optional.scriptrunner 

i know use scripts in many places inside tasks. use them this:

<script manager="bsf" language="beanshell" classpath="${bshjar}"><![cdata[ 

i guess somehow must add dependency ant-apache-bsf jar. tried

buildscript {   repositories {     mavencentral()   }   dependencies {     classpath 'org.apache.ant:ant-apache-bsf:+'   }   }  // confirm classpath contains optional jar. // jar contains required class. buildscript.configurations.classpath.each { println }  def sc = new org.apache.tools.ant.util.optional.scriptrunner(); println "sure able create script runner object: $sc"  ant.importbuild "build.xml" 

no success. there article in gradle user guide promising title 42.9 ant optional dependencies. unfortunately thing understand article solution won't work. example given there doesn't help.

what do make use of ant scripting tasks?

definitely not answer accept, workaround.

currently use beanshell scripts, through bsf engine. may convert scripts javascript, not require dependencies since jdk 6. syntax bit different, following ant tasks work in gradle+ant out of box:

<script language="javascript"><![cdata[ 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -