I am trying to create a SDK for use by other Katalon Studio projects.
I set up its build.gradle
like:
plugins {
id 'java'
id 'maven-publish'
id "com.katalon.gradle-plugin" version "0.1.1"
}
group = 'com.mikewarren'
version = '1.0'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.github.javafaker:javafaker:1.0.2'
}
task sourceJar(type: Jar) {
from sourceSets.main.allSource
archiveClassifier = 'sources'
}
sourceSets {
main {
groovy {
srcDirs = ['Keywords', 'Libs']
excludes = ['CustomKeywords.groovy', "Temp*.groovy"]
}
}
test {
groovy {
srcDirs = ['Include/scripts/groovy']
}
}
}
publishing {
publications {
katalonStudioSDK(MavenPublication) {
artifact sourceJar
groupId = project.group
// name = project.rootProject.name
description = 'Some building blocks for your Katalon Studio project'
// url = 'https://github.com/MikeWarren2014/KatalonStudioSDK'
from components.java
// licenses {
// license {
// name = 'The Apache License, Version 2.0'
// url = 'https://www.apache.org.licenses/LICENSE-2.0.txt'
// }
// }
// developers {
// developer {
// id = 'MikeWarren2014'
// name = 'Warren,Michael'
// email = 'mwarren04011990@gmail.com'
// }
// }
// scm {
// connection = "scm:git:https://github.com/MikeWarren2014/${project.rootProject.name}.git"
// developerConnection = "scm:git:git@github.com:MikeWarren2014/${project.rootProject.name}.git"
// url = "https://github.com/MikeWarren2014/${project.rootProject.name}"
// }
}
}
repositories {
maven {
url "${project.buildDir}/repo"
}
}
}
I then run gradle publish
, which returns successfully.
I then go to check out the JAR, and it has all my source code in it. This is a good enough sign.
But, when I go try to use it in another project I’m starting up, I face issues:
Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.4.2-bin.zip'.
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'ZillowScraper'.
A problem occurred configuring root project 'ZillowScraper'.
A problem occurred evaluating root project 'ZillowScraper'.
Could not find method compile() for arguments [me.mikewarren.KatalonStudioSDK:1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.Java(0)
Both these repositories are on the same machine.
What can I do to fix this, such that I can use this Katalon Studio SDK from any project?