Use gradle library com.github.mkolisnyk.cucumber.reporting into Katalon

Hello,
I would like to use this library in katalon studio : http://mkolisnyk.github.io/cucumber-reports/

As described in doc, to use this cucumber-reports library, it must be installed within gradle dependency using “compile ‘com.github.mkolisnyk:cucumber-runner:1.3.4’”

But i did not achieved to install it.
Could you help me please ?

Steps I followed :

  1. installing gradle 7.3.3 into my windows (with path)
  2. creating build.gradle file into my project folder with this contentbuild.gradle.txt (314 Bytes)
  3. launching this command (as described here https://github.com/katalon-studio/katalon-gradle-plugin):
    gradle katalonCopyDependencies

I got this error message :

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\dev\Katalon Studio\katalonreflexcore\build.gradle' line: 3

* What went wrong:
Plugin [id: 'com.katalon.gradle-plugin', version: '0.0.7'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'com.katalon.gradle-plugin:com.katalon.gradle-plugin.gradle.plugin:0.0.7')
  Searched in the following repositories:
    Gradle Central Plugin Repository

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s

Try changing to an older version of Gradle. I’m not entirely sure which versions katalon-gradle-plugin supports, but I could never get it to work with Gradle 7. Version 5.4.1 works well for me.

hello jvisser,
not better with gradle 5.4.1

perhaps does I have to install katalon gradle plugin before launching gradle command ?
I did not found gradle plugin in “manage plugin” katalon page

I always have same message :

  • Exception is:
    org.gradle.api.plugins.UnknownPluginException: Plugin [id: ‘com.katalon.gradle-plugin’, version: ‘0.0.7’] was not found in any of the following sources:

That is not necessary. katalon-gradle-plugin is used by the Gradle tool itself, not Katalon Studio.

I tried to reproduce your error message using the latest version of Gradle and could not. Perhaps there is some issue with your network connection that prevents Gradle from resolving the plugin? If you could provide the output from the below commands, I might be able to help more.
gradle --version
gradle katalonCopyDependencies --debug

I have Gradle 6.9.1

$ gradle --version
------------------------------------------------------------
Gradle 6.9.1
------------------------------------------------------------

When I tried the provided build.gradle, it worked OK but showed a warning message.

$ gradle build --warning-mode all

> Configure project :
...
The compile configuration has been deprecated for dependency declaration. This will fail with an error in Gradle 7.0. Please use the implementation configuration instead. Consult the upgrading guide for further information: https://docs.gradle.org/6.9.1/userguide/upgrading_version_5.html#dependencies_should_no_longer_be_declared_using_the_compile_and_runtime_configurations
        at build_2r967v401v7h7wis3eolqeb7e$_run_closure2.doCall(/Users/kazuakiurayama/tmp/a/build.gradle:15)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)

@staniere

I believe that the com.katalon.gradle-plugin" version "0.0.7" works with Gradle 6, but it does not work with Gradle 7 and higher. Why? See the line #48 of https://github.com/katalon-studio/katalon-gradle-plugin/blob/master/build.gradle, you would find the “compile” configuration used, and it has already been deprecated in the Gradle 7.

A quick workaround for @staniere would be downgrading Gradle to v6.9.1

However, you may have a good reason and you do not like downgrading it. In that case, another workaround is available. In fact, you do not need the com.katalon.gradle-plugin. You can write a build.gradle for yourself which does the following

  1. declare the dependencies on the external jars you need
  2. declare from which repository (of course mavenCentral())
  3. copy the jars from the ${user.home}/.m2 directory (your Maven local repository) to the Drivers directory of the Katalon Studio project, while renaming the jars a bit.

The task #3 is nearly equivalent to what the plugin does, though not the same. Here is the sample build.gradle file I use:

You want to execute the drivers task in the command line

$ cd <projectDir>
$ gradle drivers