Hello,
I am trying to utilize the Gateway Developer Plugin capability that's available to the API Gateway right now. (
https://docops.ca.com/ca-api-gateway/9-4/en/apis-and-toolkits/gateway-developer-plugin#GatewayDeveloperPlugin-Aboutbuild.gradle)
I know that this plugin primarily focuses on automation of CI/CD and for Container Gateways. I have a future client that way want to use this capability for their implementation and project so I was wondering if anyone to help assist me with this.
I did look at
BOTH the gateway-developer-plugin and the gateway-developer-example found on their GitHub pages:
https://github.com/CAAPIM/gateway-developer-pluginhttps://github.com/CAAPIM/gateway-developer-exampleI am not quite familiar with Gradle and Groovy script... so help would be appreciated.
I have downloaded IntelliJ to do some testing purposes with the Gradle scripts/files.
I have tried the following --
Scenario 1:
- Uploaded the ZIP folder of the gateway-developer-plugin GitHub site.
- Opened the main build.gradle file (without opening other folders).
- Referred back to the gateway-developer-plugin GitHub Wiki > Usage section and added the following fields needed.
- Instead of i
d "com.ca.apim.gateway.gateway-developer-plugin" version "0.8.+", I put the correct current version of
0.8.8.
The format looked like this:
/*
* Copyright (c) 2018 CA. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
plugins {
// the plus sign makes gradle pull always the latest version of the plugins
id "org.sonarqube" version "2.7"
id "com.srcclr.gradle" version "3.0.3" apply false
id "com.jfrog.bintray" version "1.8.4" apply false
id "com.ca.apim.gateway.gateway-developer-plugin" version "0.8.8"
id "com.ca.apim.gateway.gateway-export-plugin" version "0.8.8"
id "com.ca.apim.gateway.gateway-import-plugin" version "0.8.8"
}
description = 'The gateway-developer-plugin enables developing gateway configuration.'
group 'com.ca.apim.gateway'
tag {
message {
"version: ${version} build-date: " + new Date().format('yyyy-MM-dd\'T\'HH:mm:ss')
}
}
subprojects {
version = rootProject.version
apply from: rootProject.file( 'gradle/config/module.gradle' )
}
repositories {
// This is needed in order to get dependencies for the environment
// creator application that is bundled in the gw7 file.
mavenCentral()
}
// The Gateway Export Config is needed by the gateway-export plugin in order to export from a gateway
GatewayExportConfig {
folderPath = '/my-solution-folder'
}
// The Gateway Connection Config is required if setting mentioned in main [build.gradle](https://github.com/ca-api-gateway-examples/gateway-developer-example/blob/master/build.gradle) is not applicable to this folder.
GatewayConnection {
url = 'https://<gateway-host>:8443/restman'
userName = '<username>'
userPass = '<password>'
}
wrapper {
gradleVersion = '4.10.2'
}
Then prompts me an error message of:
Could not find method compile() for arguments [org.bouncycastle:bcprov-jdk15on:1.60] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. What could this mean?
I have even went into the folder \gateway-developer-plugin-master\config-builder\build.gradle file to the
compile 'org.bouncycastle:bcprov-jdk15on:1.62' and made sure the version was up to date (1.62 NOT 1.60)
Should I be adding more configurations? Am I missing files or configurations? Also for the Gradle wrapper does it need to be 4.10.2 or 5.4.1?
Scenario 2:
- Uploaded the ZIP folder of the gateway-developer-plugin GitHub site.
- Opened the main build.gradle file (without opening other folders).
- Referred back to the gateway-developer-plugin GitHub Wiki > Usage section and added the following fields needed.
- Instead of classpath
"com.ca.apim.gateway.gateway-developer-plugin" version "0.8.+", I put the correct current version of
0.8.8.
The format looked like this:
/*
* Copyright (c) 2018 CA. All rights reserved.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
// the buildscript block defines how the Gateway project is built and where are the plugins located
buildscript {
// the repositories block is where you declare project repositories
repositories {
mavenLocal() // search first on local maven
maven {
url "https://plugins.gradle.org/m2/" // second in gradle public plugins repository
}
}
// adds the plugins as dependencies
dependencies {
// "+" will always pull the latest available plugin
classpath "com.ca.apim.gateway:gateway-developer-plugin:0.8.8"
classpath "com.ca.apim.gateway:gateway-export-plugin:0.8.8"
classpath "com.ca.apim.gateway:gateway-import-plugin:0.8.8"
}
}
// configuration for subprojects, if applicable
subprojects {
// apply plugin is required to set gradle to use the plugin during build
apply plugin: 'com.ca.apim.gateway.gateway-developer-plugin'
if (!project.name.equals('deployment')) {
apply plugin: 'com.ca.apim.gateway.gateway-export-plugin'
GatewayConnection {
url = 'https://localhost:8443/restman'
userName = '<username>'
userPass = '<password>'
}
} else {
apply plugin: 'com.ca.apim.gateway.gateway-import-plugin'
}
group 'com.ca.apim.gateway'
version = '0.8.0'
// this repositories config refers specifically to the dependencies in the project
repositories {
mavenLocal()
flatDir {
dirs new File(project.parent.rootDir, "lib")
}
jcenter()
}
}
wrapper {
gradleVersion = '4.10.2'
}
Once I try to run/build this, I receive the
same error message. Why is this the case? I have check for the
bcprov-jdk15on (https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on) to be existent and present in the Maven Repository. It is, however, the version listed at first was 1.60 but changed it to 1.62 since it is the current up-to-date version. Either version still prompts me the same error message.
Also I would try another format then get prompted an error message such as: Unable to find method 'org.apache.commons.lang3.tuple.ImmutablePair.nullPair()Lorg/apache/commons/lang3/tuple/ImmutablePair;'.
I am struggling if there is anything that is needed to be done prior to executing this plugin? Am I miss any files/parameters? Is this the incorrect format for building in Gradle? Are other files needed to be updated in order for this to execute?
Please let me know your thoughts. I have attached some screenshots of the syntax again and error messages. Thanks all!