Hi,
Im trying to create an Custom keywords plugin. It turns out that my keyword will use some external jars. In this case i will use org.apache.poi jar that i already added to Driver folder. My build.gradle looks like
plugins {
id 'java'
id 'groovy'
id 'com.github.johnrengelman.shadow' version '4.0.4'
id "com.katalon.gradle-plugin" version "0.0.6"
}
repositories {
jcenter()
mavenCentral()
}
sourceSets {
main {
groovy {
srcDirs = ['Keywords', 'Include/scripts/groovy']
srcDir 'Libs'
}
}
}
shadowJar {
exclude 'Temp*.class'
}
katalon {
dependencyPrefix = "com.katalon"
minimize = false
}
jar {
from fileTree("$buildDir/dependencies/")
}
task extractDependencies(type: Sync) {
dependsOn configurations.compile
from (configurations.compile.collect {
zipTree(it)
})
exclude 'META-INF/**'
into "$buildDir/dependencies/"
}
jar.dependsOn extractDependencies
and my katalon-plugin.json look like
{
"keywords": ["keywordName"]
}
I do not added an package because is to ugly when we call âCustom Keywordâ - com.test.name1.name2.etc.keywordName
Note that in build folder i create the folder âdependenciesâ and added the same jarâs that i added into Katalon Driver folder.
But when i add the generated plugin into âPluginsâ folder from another project an error always appear "
com.kms.katalon.plugin.models.ReloadPluginsException: Unexpected error occurs during executing reload plugins
at com.kms.katalon.plugin.service.PluginService.reloadPlugins(PluginService.java:253)
at com.kms.katalon.composer.handlers.ReloadPluginsHandler$1.run(ReloadPluginsHandler.java:79)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:657)
at java.util.ArrayList.get(ArrayList.java:433)
at java_util_List$get$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at com.kms.katalon.custom.generation.CustomKeywordTemplate.getParameterName(CustomKeywordTemplate.groovy:177)
at com.kms.katalon.custom.generation.CustomKeywordTemplate$getParameterName$0.callStatic(Unknown Source)
at com.kms.katalon.custom.generation.CustomKeywordTemplate.getInitialExpression(CustomKeywordTemplate.groovy:155)
at com.kms.katalon.custom.generation.CustomKeywordTemplate$getInitialExpression.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at groovy.tmp.templates.GStringTemplateScript23$_getTemplate_closure1$_closure3$_closure4$_closure5.doCall(GStringTemplateScript23.groovy:18)
etc....
Can anyone help me with this problem?
Have a nice day.