Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Configuration {
- val content = javaClass.classLoader.getResource("app.properties").readText()
- }
- Exception in thread "main" java.lang.ExceptionInInitializerError
- at com.example.AppKt.main(App.kt:8)
- Caused by: java.lang.IllegalStateException: javaClass.classLoader.ge…esource("app.properties") must not be null
- at com.example.Configuration.<clinit>(Configuration.kt:4)
- ... 1 more
- my-app
- ├── backend
- | ├── build.gradle
- | └── src
- | └── main
- | ├── kotlin
- | └── resources <-- app.properties here
- ├── common
- | ├── build.gradle
- | └── src
- | └── main
- | ├── kotlin
- | └── resources
- ├── frontend
- | ├── build.gradle
- | └── src
- | └── main
- | ├── kotlin
- | └── resources
- └── build.gradle
- apply plugin: 'kotlin'
- apply plugin: 'kotlin-platform-jvm'
- apply plugin: 'com.github.johnrengelman.shadow'
- buildscript {
- ext {
- exposed_version = '0.10.2'
- h2_version = '1.4.197'
- hikari_version = '3.1.0'
- konfig_version = '1.6.7.0'
- ktor_version = '0.9.2'
- logback_version = '1.2.3'
- shadow_version = '2.0.4'
- }
- dependencies {
- classpath "com.github.jengelman.gradle.plugins:shadow:$shadow_version"
- }
- }
- repositories {
- maven { url 'https://dl.bintray.com/kotlin/ktor' }
- maven { url 'https://dl.bintray.com/kotlin/exposed' }
- }
- dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
- implementation "io.ktor:ktor-auth:$ktor_version"
- implementation "io.ktor:ktor-gson:$ktor_version"
- implementation "io.ktor:ktor-html-builder:$ktor_version"
- implementation "io.ktor:ktor-server-netty:$ktor_version"
- implementation "com.h2database:h2:$h2_version"
- implementation "com.zaxxer:HikariCP:$hikari_version"
- implementation "org.jetbrains.exposed:exposed:$exposed_version"
- implementation "ch.qos.logback:logback-classic:$logback_version"
- implementation "com.natpryce:konfig:$konfig_version"
- expectedBy project(':common')
- }
- configurations {
- implementation {
- exclude group: 'org.jetbrains.kotlin', module: 'kotlin-runtime'
- }
- }
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
- compileKotlin {
- kotlinOptions.jvmTarget = '1.8'
- }
- compileTestKotlin {
- kotlinOptions.jvmTarget = '1.8'
- }
- kotlin {
- experimental {
- coroutines 'enable'
- }
- }
Add Comment
Please, Sign In to add comment