GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-kotlin
/
sample-kotlin-spring1
Browse code
Remove shadowJar
master
1 parent
a178524
commit
58e46adb47532dd498d0ba611bee8fcd631c5542
yhornisse
authored
on 8 May 2020
Patch
Showing
2 changed files
README.md
build.gradle.kts
Ignore Space
Show notes
View
README.md
# Kotlin + Spring のサンプル ## そのまま実行(UNIX系OSやMacの場合) ``` $ ./gradlew bootRun ``` ## Fat Jar作成(UNIX系OSやMacの場合) ``` $ ./gradlew bootJar ``` ## Fat Jarを実行 ``` $ java -jar build/libs/SampleKotlin-1.0-SNAPSHOT-all.jar ``` ``` http://localhost:8080/hello ```
# Kotlin + Spring のサンプル ## そのまま実行(UNIX系OSやMacの場合) ``` $ ./gradlew bootRun ``` ## Fat Jar作成(UNIX系OSやMacの場合) ``` $ ./gradlew shadowJar ``` ## Fat Jarを実行 ``` $ java -jar build/libs/SampleKotlin-1.0-SNAPSHOT-all.jar ``` ``` http://localhost:8080/hello ```
Ignore Space
Show notes
View
build.gradle.kts
group = "org.example" version = "1.0-SNAPSHOT" plugins { application kotlin("jvm") version "1.3.61" kotlin("plugin.spring") version "1.3.50" id("org.springframework.boot") version "2.1.3.RELEASE" id("io.spring.dependency-management") version "1.0.9.RELEASE" } application { mainClassName = "com.example.sample.SpringSampleApplicationKt" } repositories { mavenCentral() jcenter() } dependencies { implementation(group = "org.springframework.boot", name = "spring-boot-starter") implementation(group = "org.springframework.boot", name = "spring-boot-starter-web") implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin") } tasks { withType<Jar> { manifest { attributes( mapOf( "Main-Class" to application.mainClassName ) ) } } }
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar group = "org.example" version = "1.0-SNAPSHOT" plugins { application kotlin("jvm") version "1.3.61" kotlin("plugin.spring") version "1.3.50" id("org.springframework.boot") version "2.1.3.RELEASE" id("io.spring.dependency-management") version "1.0.9.RELEASE" id("com.github.johnrengelman.shadow") version "5.0.0" } application { mainClassName = "com.example.sample.SpringSampleApplicationKt" } repositories { mavenCentral() jcenter() } dependencies { implementation(group = "org.springframework.boot", name = "spring-boot-starter") implementation(group = "org.springframework.boot", name = "spring-boot-starter-web") implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin") } tasks { withType<Jar> { manifest { attributes( mapOf( "Main-Class" to application.mainClassName ) ) } } }
Show line notes below