Skip to content

Commit

Permalink
doc(docs.topics.jvm.getStartedSpringBoot): add notes and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredo-toledano committed Aug 25, 2024
1 parent 4dbcb4a commit b61119b
Show file tree
Hide file tree
Showing 13 changed files with 551 additions and 287 deletions.
287 changes: 0 additions & 287 deletions docs/topics/jvm/jvm-create-project-with-spring-boot.md

This file was deleted.

40 changes: 40 additions & 0 deletions docs/topics/jvm/spring/getStartedSpringBoot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Kotlin ###
.kotlin
11 changes: 11 additions & 0 deletions docs/topics/jvm/spring/getStartedSpringBoot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## How has it been created?
* Following ALL "*.md" here

## How to run it locally?
* via IDE
* click the green **Run** icon in the gutter and select **Run 'MainKt'**
* via CL
* `./gradlew bootRun`

## Sample requests
* http://localhost:8080?name=John
43 changes: 43 additions & 0 deletions docs/topics/jvm/spring/getStartedSpringBoot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
plugins {
kotlin("jvm") version "1.9.25" // kotlin version / use | project
kotlin("plugin.spring") version "1.9.25" // Kotlin Spring compiler
// -- ad `open` | Kotlin classes -- Reason: make them -- compatible with -- Spring Framework features--

id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
}

group = "com.example"
version = "0.0.1-SNAPSHOT"

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

repositories {
mavenCentral()
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-jdbc")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin") // serialize & deserialize Kotlin classes & data classes
implementation("org.jetbrains.kotlin:kotlin-reflect")
runtimeOnly("com.h2database:h2")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
// add extra arguments -- to the -- compiler
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b61119b

Please sign in to comment.