Skip to content

Commit

Permalink
Added Spring boot with status API
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmathew committed Jun 28, 2024
1 parent 81322c7 commit b214196
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 7 deletions.
24 changes: 24 additions & 0 deletions .fleet/run.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"configurations": [
{
"name": "OpenID-Federation [:server:build]",
"type": "gradle",
"workingDir": "C:\\Users\\Robo\\Sphereon\\OpenID-Federation",
"tasks": [":server:build"],
"args": [""],
"initScripts": {
"flmapper": "ext.mapPath = { path -> null }"
}
},
{
"name": "OpenID-Federation [build]",
"type": "gradle",
"workingDir": "C:\\Users\\Robo\\Sphereon\\OpenID-Federation",
"tasks": ["build"],
"args": [""],
"initScripts": {
"flmapper": "ext.mapPath = { path -> null }"
}
}
]
}
12 changes: 12 additions & 0 deletions .fleet/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
{
"type": "add",
"pluginName": "fleet.spring.boot"
},
{
"type": "add",
"pluginName": "fleet.mercury"
}
]
}
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ plugins {
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlinJvm) apply false
alias(libs.plugins.kotlinMultiplatform) apply false
alias(libs.plugins.springboot) apply false
alias(libs.plugins.springDependencyManagement) apply false
alias(libs.plugins.kotlinPluginSpring) apply false
}
12 changes: 5 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ compose-plugin = "1.6.10"
junit = "4.13.2"
kotlin = "2.0.0"
kotlinxSerializationJson = "1.7.0-RC"
ktor = "2.3.11"
logback = "1.5.6"
springboot = "3.3.1"
spingDependencyManagement = "1.1.5"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand All @@ -29,16 +29,14 @@ androidx-material = { group = "com.google.android.material", name = "material",
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }
logback = { module = "ch.qos.logback:logback-classic", version.ref = "logback" }
ktor-server-core = { module = "io.ktor:ktor-server-core-jvm", version.ref = "ktor" }
ktor-server-netty = { module = "io.ktor:ktor-server-netty-jvm", version.ref = "ktor" }
ktor-server-tests = { module = "io.ktor:ktor-server-tests-jvm", version.ref = "ktor" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
androidLibrary = { id = "com.android.library", version.ref = "agp" }
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlinJvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
ktor = { id = "io.ktor.plugin", version.ref = "ktor" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
springboot = { id = "org.springframework.boot", version.ref = "springboot"}
springDependencyManagement = { id = "io.spring.dependency-management", version.ref = "spingDependencyManagement"}
kotlinPluginSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" }
42 changes: 42 additions & 0 deletions server/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
plugins {
alias(libs.plugins.springboot)
alias(libs.plugins.springDependencyManagement)
alias(libs.plugins.kotlinJvm)
alias(libs.plugins.kotlinPluginSpring)
application
}

group = "com.sphereon.oid.fed"
version = "1.0.0"

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

dependencies {

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")


testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")

runtimeOnly("org.springframework.boot:spring-boot-devtools")
//testImplementation(libs.kotlin.test.junit)
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
11 changes: 11 additions & 0 deletions server/src/main/kotlin/com/sphereon/oid/fed/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.sphereon.oid.fed

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class Application

fun main(args: Array<String>) {
runApplication<Application>(*args)
}
4 changes: 4 additions & 0 deletions server/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
spring.application.name=OpenID Federation

management.endpoints.web.base-path=/
management.endpoints.web.path-mapping.health=status
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ dependencyResolutionManagement {
}

include(":modules:openid-federation-common")
include(":server")

0 comments on commit b214196

Please sign in to comment.