diff --git a/build.gradle.kts b/build.gradle.kts index 22fd2ec..6544fcd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,6 +38,12 @@ subprojects { apply { plugin("io.spring.dependency-management") } + + the().apply { + imports { + mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES) + } + } } tasks.withType { diff --git a/demo/.gitignore b/demo/.gitignore new file mode 100644 index 0000000..c2065bc --- /dev/null +++ b/demo/.gitignore @@ -0,0 +1,37 @@ +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/ diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts new file mode 100644 index 0000000..a7c1c26 --- /dev/null +++ b/demo/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + id("org.springframework.boot") + id("io.spring.dependency-management") + kotlin("jvm") + kotlin("plugin.spring") +} + +dependencies { + api(project(":lib")) + + implementation("org.springframework.boot:spring-boot-starter-web") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") + testImplementation("org.springframework.boot:spring-boot-starter-test") +} + +tasks.withType { + useJUnitPlatform() +} diff --git a/demo/gradle/wrapper/gradle-wrapper.jar b/demo/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/demo/gradle/wrapper/gradle-wrapper.jar differ diff --git a/demo/gradle/wrapper/gradle-wrapper.properties b/demo/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..12d38de --- /dev/null +++ b/demo/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/demo/src/main/kotlin/com/example/demo/DemoApplication.kt b/demo/src/main/kotlin/com/example/demo/DemoApplication.kt new file mode 100644 index 0000000..6400725 --- /dev/null +++ b/demo/src/main/kotlin/com/example/demo/DemoApplication.kt @@ -0,0 +1,17 @@ +package com.example.demo + +import com.example.lib.MyLib +import org.springframework.boot.CommandLineRunner +import org.springframework.boot.autoconfigure.SpringBootApplication +import org.springframework.boot.runApplication + +@SpringBootApplication +class DemoApplication : CommandLineRunner { + override fun run(vararg args: String?) { + MyLib.doOnMe() + } +} + +fun main(args: Array) { + runApplication(*args) +} diff --git a/demo/src/main/resources/application.properties b/demo/src/main/resources/application.properties new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/demo/src/main/resources/application.properties @@ -0,0 +1 @@ + diff --git a/demo/src/test/kotlin/com/example/demo/DemoApplicationTests.kt b/demo/src/test/kotlin/com/example/demo/DemoApplicationTests.kt new file mode 100644 index 0000000..875f277 --- /dev/null +++ b/demo/src/test/kotlin/com/example/demo/DemoApplicationTests.kt @@ -0,0 +1,13 @@ +package com.example.demo + +import org.junit.jupiter.api.Test +import org.springframework.boot.test.context.SpringBootTest + +@SpringBootTest +class DemoApplicationTests { + + @Test + fun contextLoads() { + } + +} diff --git a/lib/.gitignore b/lib/.gitignore new file mode 100644 index 0000000..c2065bc --- /dev/null +++ b/lib/.gitignore @@ -0,0 +1,37 @@ +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/ diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts new file mode 100644 index 0000000..6bc4092 --- /dev/null +++ b/lib/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("io.spring.dependency-management") + kotlin("jvm") + kotlin("plugin.spring") +} + +dependencies { + implementation("org.springframework.boot:spring-boot-starter") + implementation("org.jetbrains.kotlin:kotlin-reflect") + implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") +} \ No newline at end of file diff --git a/lib/gradle/wrapper/gradle-wrapper.jar b/lib/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000..e708b1c Binary files /dev/null and b/lib/gradle/wrapper/gradle-wrapper.jar differ diff --git a/lib/gradle/wrapper/gradle-wrapper.properties b/lib/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..12d38de --- /dev/null +++ b/lib/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,5 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/lib/src/main/kotlin/com/example/lib/MyLib.kt b/lib/src/main/kotlin/com/example/lib/MyLib.kt new file mode 100644 index 0000000..67ba8fb --- /dev/null +++ b/lib/src/main/kotlin/com/example/lib/MyLib.kt @@ -0,0 +1,5 @@ +package com.example.lib + +object MyLib { + fun doOnMe() = print("hello") +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index fc0358c..eff4bc5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1 +1,3 @@ - rootProject.name = "sample-modules" \ No newline at end of file + rootProject.name = "sample-modules" + + include("demo", "lib") \ No newline at end of file