We are trying to setup the Policy Plugin in my desktop environment and having some issues to run with below steps.
Step1: Installed Gradle
C:\apps\CodeRepo\policyplugin\GatewayPolicyPlugin-Gettingstarted-master\GatewayPolicyPlugin-helloworld>gradle -v
------------------------------------------------------------
Gradle 7.1.1
------------------------------------------------------------
Build time: 2021-07-02 12:16:43 UTC
Revision: 774525a055494e0ece39f522ac7ad17498ce032c
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_231 (Oracle Corporation 25.231-b11)
OS: Windows 10 10.0 amd64
Step2: Using our own existing gateway and created the policy
Step3: Downloaded package from https://github.com/CAAPIM/GatewayPolicyPlugin-Gettingstarted
Step4: Updated the build.gradle file with our own gateway connection
Step5: Running gradle having issues with below, also attached the file with --debug mode
C:\apps\CodeRepo\policyplugin\GatewayPolicyPlugin-Gettingstarted-master\GatewayPolicyPlugin-helloworld>gradle
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\apps\CodeRepo\policyplugin\GatewayPolicyPlugin-Gettingstarted-master\GatewayPolicyPlugin-helloworld\build.gradle' line: 14
* What went wrong:
A problem occurred evaluating root project 'helloworld'.
> Failed to apply plugin 'com.ca.apim.gateway.gateway-export-plugin'.
> Could not create an instance of type com.ca.apim.gateway.cagatewayexport.config.GatewayExportPluginConfig.
> org.gradle.api.file.ProjectLayout.directoryProperty()Lorg/gradle/api/file/DirectoryProperty;
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 2s
C:\apps\CodeRepo\policyplugin\GatewayPolicyPlugin-Gettingstarted-master\GatewayPolicyPlugin-helloworld>gradle -v
------------------------------------------------------------
Gradle 7.1.1
------------------------------------------------------------
Build time: 2021-07-02 12:16:43 UTC
Revision: 774525a055494e0ece39f522ac7ad17498ce032c
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_231 (Oracle Corporation 25.231-b11)
OS: Windows 10 10.0 amd64
Release : 10.0
Component : API GATEWAY
There is a version issue with GRADLE if it's not 4.10.2
One of two choices
1. Use GRADLE 4.10.2
I download 4.10.2 followed the steps for helloworld exported policy
Results:
C:\gradle-4.10.2\project\GatewayPolicyPlugin-Gettingstarted\GatewayPolicyPlugin-helloworld>gradle clean export
BUILD SUCCESSFUL in 44s
3 actionable tasks: 3 executed
OR
2. Use higher version but you must include a wrapper in the build.gradle
wrapper {
gradleVersion = '4.10.2'
}
buildscript {
repositories {
gradlePluginPortal()
mavenCentral()
jcenter()
}
.
.
.
Than
gradle clean export