Slackbot
02/08/2024, 9:59 PMVampire
02/09/2024, 12:29 AMAntek -
02/09/2024, 7:35 PMPS C:\Users\X\Desktop\freshood\freshNearMe> ./gradlew clean build
Starting a Gradle Daemon, 1 incompatible and 8 stopped Daemons could not be reused, use --status for details
> Task :modules:kaptKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':modules:kaptKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
This is Gradle multi-module project, maybe I have wrongly added the dependencies. Could you check my gradle build file? https://pastebin.com/9rMcujy9Vampire
02/09/2024, 10:30 PMAntek -
02/10/2024, 5:58 PMVampire
02/11/2024, 3:02 PMgradle.properties
to define version, but use a version catalog
⢠Use a version catalog for all the dependencies
⢠Do not use subprojects { ... }
or allprojects { ... }
or project(...) { ... }
or similar means of cross-project configuration, that makes builds harder to understand, harder to maintain, and immediately introduces project coupling which works against some optimizations and more sophisiticated Gradle features. Better use convention plugins, for example in buildSrc
or an included build, for example implemented as precompiled script plugins.
⢠Do not use the legacy apply(...)
way to apply plugins but always the plugins { ... }
blockAntek -
02/12/2024, 3:22 PMVampire
02/12/2024, 3:45 PMplugins { ... }
in cross-project configuration, but - well - you shouldn't use cross-project configuration. šAntek -
02/13/2024, 1:05 AMval ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
val koin_ktor: String = "3.5.1"
val mapStructVersion = "latest.release"
plugins {
java
checkstyle
id("com.github.spotbugs")
//LEAD TO FAIL
kotlin("jvm")
kotlin("kapt")
id("io.ktor.plugin")
id("org.jetbrains.kotlin.plugin.serialization")
}
group = "com.example"
version = "1.0"
tasks.test {
useJUnitPlatform()
}
repositories {
mavenCentral()
}
dependencies {
implementation( "com.github.javafaker:javafaker:1.0.2")
testImplementation("junit:junit:4.13")
//many other dependencies, like mapstruct etc...
}
why is this ain't working?
FAILURE: Build failed with an exception.
* Where:
Precompiled script plugin 'C:\Users\zwo7a\IdeaProjects\FreshNearMe\buildSrc\src\main\kotlin\myproject.java-conventions.gradle.kts' line: 1
* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.jvm'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
Some of my dependencies require extra plugins, where should i add them?Vampire
02/13/2024, 1:17 AM