kotlin spring boot 3 - cannot resolve spring-boot-gradle-plugin:3.0.0 - spring

I'm getting a weird resolution error when trying to upgrade to spring boot 3. I have a kotlin/spring project. The only thing sort of related is this, but it's not the same dependency.
Here's the error:
Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.0.
Here's my dependency declaration:
plugins {
id 'io.spring.dependency-management' version '1.1.0' // latest at this time
id 'org.springframework.boot' version '3.0.0'
id 'org.jetbrains.kotlin.plugin.jpa' version '1.7.10'
id 'org.jetbrains.kotlin.plugin.spring' version '1.7.10'
}
Here's my full output:
What I've tried:
Switching to Java 17
Searching online for the same exact error - no luck so far. (11-29-2022 10AM ET)

Modify the Gradle JVM in the settings

Related

Getting error building a gradle project: An exception occurred applying plugin request [id: 'org.jetbrains.intellij', version: '1.5.2']

I am getting the next error message when I build a gradle project (gradle build):
An exception occurred applying plugin request [id: 'org.jetbrains.intellij', version: '1.5.2']
> Failed to apply plugin [id 'org.jetbrains.intellij']
> Could not create an instance of type org.jetbrains.intellij.utils.ArchiveUtils.
> Could not generate a decorated class for type ArchiveUtils.
> org/gradle/api/file/ArchiveOperations
My plugin section looks like this:
plugins {
id 'org.jetbrains.intellij' version '1.5.2'
id 'jacoco'
id 'groovy'
id 'signing'
id 'maven-publish'
}
I am using java version 11 and gradle 7.6. Not sure at this moment what is happening. I didn't find enough info regarding this error.
Any ideas?
Thanks!

tomcat-embed-core:10.1.0-M16 will make the import javax.servlet.http.HttpServletResponse cannot be resolve

If I put the latest org.apache.tomcat.embed:tomcat-embed-core:10.1.0-M16 dependecy, it will make the import javax.servlet.http.HttpServletResponse cannot be resolve.
Here's my build.gradle,
plugins {
id 'org.springframework.boot' version '2.7.0'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'war'
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.apache.tomcat.embed:tomcat-embed-core:10.1.0-M16'
}
How do I fixed this?
Thank you!
tomcat-embed-core:9.0.63 provided by Spring Boot also contained repackaged classes from javax.servlet-api library, but they are no longer present in 10.1 branch due to migration from javax.servlet to jakarta.servlet. You could manually add this dependency to fix the compilation error:
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
However, this alone won't fix the issue, as Spring Boot 2.7 is just not internally compatible with Tomcat 10.1 because of its migration from javax.servlet to Jakarta APIs. If you want to try Tomcat 10.1 with Spring Boot, you'd most probably have to wait until Spring Boot 3 comes out. See more info in Spring Boot blog.

Trying to run a cloned project with gradle but unable to build

I have cloned a Spring boot project from github and I have opened it in intellij. So I am trying to run the build.gradle but I just get this error:
An exception occurred applying plugin request [id: 'org.springframework.boot', version: '2.3.3.RELEASE']
Failed to apply plugin [id 'org.springframework.boot']
Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 5.2
This is the plugin:
plugins {
id 'org.springframework.boot' version '2.3.3.RELEASE'
id 'io.spring.dependency-management' version '1.0.10.RELEASE'
id 'java'
}
What is going on here?
You have Gradle version 5.2. The error states that the Spring Boot plugin specifically requires either 5.6.x (e.g., 5.6.4) or a version greater than or equal to 6.3 (e.g., 6.3, 6.6.1).
You need to upgrade your Gradle version to a 5.6 variant or a newer version that is greater than or equal to 6.3.
You need to configure a Gradle version for a project to be 5.6.x only or 6.3 or later:
If wrapper.properties is used for the project the Gradle version is saved in the gradle-wrapper.properties file in the gradle directory of your project.
See detailed steps at Configure a Gradle version for a project
documentation page.

Spring boot gradle project with kotlin setup issue

Hello i want to create a Spring boot app with kotlin and Gradle but i have this issue in the plugins line, it doens't recognize any plugin i add ,i couldn't undrestand what's missing, i'm using Gradle 6.3v , jdk 8
Error:
Error
And that's the build.gradle file
build.gradle.kts
Your first plugin declaration has a typo in the version:
kotlin("jvm") version "1.3.11" needs to be kotlin("jvm") version "1.3.71"
I would start by changing that so all usages of kotlin plugins are aligned on a recent version.
If that does not resolve the problem, try running the build from the CLI with the added flag --stacktrace which may tell you more about why is the plugin not found.

Cannot find Plugin [id: 'com.github.johnrengelman.shadow', version: '5.2.0']

I'm currently trying to create a simple discord bot. I finished the code and I'm trying to export it through shadow--> shadowJar. I keep getting this error message:
Plugin [id: 'com.github.johnrengelman.shadow', version: '5.2.0'] 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.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:5.2.0')
Searched in the following repositories:
Gradle Central Plugin Repository
I've tried to look up how to fix this, being pretty unsuccessful. I'm very new to this, only having experience with simple Java, like multi-dimensional arrays, classes, objects, etc.
Please help!
Here's my build.gradle:
plugins {
id 'java'
id 'application'
id "com.github.johnrengelman.shadow" version "5.2.0"
}
mainClassName = "Main"
group 'com.mywebsite'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'net.dv8tion:JDA:3.5.0_329'
}
At the time of writing this answer, the shadow plugin's latest version is 2.0.3.
So I have no idea where you sourced that 5.2.0 from but this is the issue: there is no shadow plugin version 5.2.0 out there.

Resources