Tim Schraepen
06/22/2021, 9:53 PMbuildSrc
module, with the kotlin-dsl
convention plugin (as is suggested as a best practice according to the Gradle Docs, but I’ve had quite a bit of issues with these convention plugin scripts not compiling in IntelliJ etc).
I’m using IntelliJ as my IDE, but a normal gradlew clean build
fails on the same compilation error.
e: .../SecurityConfig.kt: (15, 9): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
public operator fun <T, R> DeepRecursiveFunction<TypeVariable(T), TypeVariable(R)>.invoke(value: TypeVariable(T)): TypeVariable(R) defined in kotlin
The http: HttpSecurity
function argument to my WebSecurityConfigurerAdapter
impl doesn’t seem to support a configuration lambda.
Any help is appreciated. 🙏Tim Schraepen
06/22/2021, 9:55 PMplugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.10")
implementation("org.jetbrains.kotlin.plugin.spring:org.jetbrains.kotlin.plugin.spring.gradle.plugin:1.4.21")
implementation("org.springframework.boot:spring-boot-gradle-plugin:2.5.1")
implementation("io.spring.dependency-management:io.spring.dependency-management.gradle.plugin:1.0.11.RELEASE")
implementation("com.github.jengelman.gradle.plugins:shadow:6.1.0")
}
Tim Schraepen
06/22/2021, 9:56 PMplugins {
id("scrambledeggs.kotlin.library-conventions")
id("scrambledeggs.spring.web-conventions")
id("scrambledeggs.spring.security-conventions")
}
dependencies {
api(project(":infra"))
api(project(":domain:core-api"))
api(project(":domain:leaderboards-api"))
}
Tim Schraepen
06/22/2021, 10:30 PM./gradlew adapter:rest-api:dependencies
I do notice that the spring-security-config
dependency is there:
+--- org.springframework.boot:spring-boot-starter-security -> 2.5.1
| +--- org.springframework.boot:spring-boot-starter:2.5.1 (*)
| +--- org.springframework:spring-aop:5.3.8 (*)
| +--- org.springframework.security:spring-security-config:5.5.0
This contains a kotlin class HttpSecurityDsl
along with an extension function that’s supposed to activate the Dsl, but for some reason won’t in my IntelliJ, nor in my gradle compile.Tim Schraepen
06/22/2021, 10:32 PMhttp.invoke
I want to cry. 😭😭😭
This just took me >3 hours.kqr
06/23/2021, 9:15 AMTim Schraepen
06/23/2021, 5:26 PM