Hi team, I am very new to gradle so sorry if my question seems easy.
I am following this tutorial: Smithy Server and Client Generator for TypeScript (Developer Preview) | AWS DevOps Blog which shows how to use smithy.
Here is the repo they have in the project which I cloned: https://github.com/aws-samples/smithy-server-generator-typescript-sample.
After cloning, I ran the command
./gradlew build
But I am getting the following error:
Could not find implementation class 'software.amazon.smithy.gradle.SmithyPlugin' for plugin 'software.amazon.smithy' specified in jar:file:/Users/<my-user-folder>/.gradle/caches/jars-9/022b97b49ec9b69ec2bcb4f44810206a/FinplifyModel-0.6.0.jar!/META-INF/gradle-plugins/software.amazon.smithy.properties.
I think that this might be some caching issue because the jar mentioned in the error:
FinplifyModel-0.6.0.jar!
Is not even part of this project. It is an old project I built on my machine couple of weeks ago. I am not sure why it’s cache is getting involved in this new project build.
Here is the build.gradle.kts for the FinplifyModel package that was built some weeks ago:
gradlePlugin {
plugins {
create("software.amazon.smithy") {
id = "software.amazon.smithy"
displayName = "Smithy Gradle Plugin"
description = "This project integrates Smithy with Gradle. This plugin can build artifacts " +
"from Smithy models, generate JARs that contain Smithy models found in Java " +
"projects, and generate JARs that contain filtered *projections* of Smithy " +
"models."
implementationClass = "software.amazon.smithy.gradle.SmithyPlugin"
}
}
}
pluginBundle {
website = "https://github.com/awslabs/smithy"
vcsUrl = "https://github.com/awslabs/smithy"
tags = listOf("smithy", "api", "building")
}
Here is the build.gradle for the new project:
import software.amazon.smithy.gradle.tasks.SmithyBuild
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "software.amazon.smithy.demo:string-wizard-model:1.0-SNAPSHOT";
classpath "software.amazon.smithy.typescript:smithy-typescript-codegen:0.11.0";
classpath "software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.11.0";
classpath "software.amazon.smithy:smithy-model:1.19.0";
classpath "software.amazon.smithy:smithy-openapi:1.19.0";
classpath "software.amazon.smithy:smithy-aws-traits:1.19.0";
classpath "software.amazon.smithy:smithy-aws-apigateway-openapi:1.19.0";
classpath "software.amazon.smithy:smithy-cli:1.19.0";
}
}
plugins {
id "software.amazon.smithy"
}
dependencies {
implementation "software.amazon.smithy:smithy-aws-traits:1.19.0"
implementation "software.amazon.smithy:smithy-aws-apigateway-openapi:1.19.0"
implementation "software.amazon.smithy.demo:string-wizard-model:1.0-SNAPSHOT"
}
repositories {
mavenLocal()
mavenCentral()
}
jar.enabled = false
smithyBuildJar.enabled = false
task generateServer(type: SmithyBuild) {}
build.dependsOn generateServer
Does anyone has an idea of what could be going wrong?