Compare commits
10 Commits
main
...
a27388320f
| Author | SHA1 | Date | |
|---|---|---|---|
| a27388320f | |||
| 294110af96 | |||
| cfe8efdf5a | |||
| 981f074049 | |||
| 97d3934905 | |||
| 68642dc16f | |||
| 9bdb8487eb | |||
| b25dfaa656 | |||
| bf4ce4c02e | |||
| f06a64767c |
@@ -1,9 +1,9 @@
|
||||
# Sample Modules
|
||||
- Including parent deps
|
||||
- Spring Boot
|
||||
- Spring Boot (2.4.1)
|
||||
- Spring Dependency Management
|
||||
- Gradle with Kotlin DSL (6.6.1)
|
||||
- Kotlin Langauge
|
||||
- Kotlin Langauge (1.4.21)
|
||||
|
||||
# Development
|
||||
- Clone the modules
|
||||
@@ -25,4 +25,4 @@ include("gradle-sample-module-example")
|
||||
### Implementation module in ```build.gradle.kts```
|
||||
```gradle
|
||||
implementation(project(":gradle-sample-module-example"))
|
||||
```
|
||||
```
|
||||
|
||||
@@ -7,10 +7,10 @@ buildscript {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("org.springframework.boot") version "2.4.0" apply false
|
||||
id("io.spring.dependency-management") version "1.0.10.RELEASE" apply false
|
||||
kotlin("jvm") version "1.4.10" apply false
|
||||
kotlin("plugin.spring") version "1.4.10" apply false
|
||||
id("org.springframework.boot") version "2.4.2" apply false
|
||||
id("io.spring.dependency-management") version "1.0.11.RELEASE" apply false
|
||||
kotlin("jvm") version "1.4.21" apply false
|
||||
kotlin("plugin.spring") version "1.4.21" apply false
|
||||
}
|
||||
|
||||
allprojects {
|
||||
@@ -38,4 +38,14 @@ subprojects {
|
||||
apply {
|
||||
plugin("io.spring.dependency-management")
|
||||
}
|
||||
|
||||
the<io.spring.gradle.dependencymanagement.dsl.DependencyManagementExtension>().apply {
|
||||
imports {
|
||||
mavenBom(org.springframework.boot.gradle.plugin.SpringBootPlugin.BOM_COORDINATES)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
|
||||
enabled = false
|
||||
}
|
||||
3
build.sh
Executable file
3
build.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
bash gradlew clean && bash gradlew build -x test
|
||||
37
demo/.gitignore
vendored
Normal file
37
demo/.gitignore
vendored
Normal file
@@ -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/
|
||||
25
demo/build.gradle.kts
Normal file
25
demo/build.gradle.kts
Normal file
@@ -0,0 +1,25 @@
|
||||
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<Test> {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
|
||||
tasks.withType<org.springframework.boot.gradle.tasks.bundling.BootJar> {
|
||||
enabled = true
|
||||
}
|
||||
BIN
demo/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
demo/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
demo/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
demo/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -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
|
||||
22
demo/src/main/kotlin/com/example/demo/DemoApplication.kt
Normal file
22
demo/src/main/kotlin/com/example/demo/DemoApplication.kt
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.example.demo
|
||||
|
||||
import com.example.lib.MyLib
|
||||
import com.example.lib.MyUtils
|
||||
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()
|
||||
|
||||
println()
|
||||
|
||||
println("Hello JJKK: ${MyUtils.helloWorld()}")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
runApplication<DemoApplication>(*args)
|
||||
}
|
||||
1
demo/src/main/resources/application.properties
Normal file
1
demo/src/main/resources/application.properties
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
}
|
||||
37
lib/.gitignore
vendored
Normal file
37
lib/.gitignore
vendored
Normal file
@@ -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/
|
||||
12
lib/build.gradle.kts
Normal file
12
lib/build.gradle.kts
Normal file
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
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")
|
||||
}
|
||||
BIN
lib/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
lib/gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
5
lib/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
5
lib/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -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
|
||||
7
lib/src/main/java/com/example/lib/MyUtils.java
Normal file
7
lib/src/main/java/com/example/lib/MyUtils.java
Normal file
@@ -0,0 +1,7 @@
|
||||
package com.example.lib;
|
||||
|
||||
public final class MyUtils {
|
||||
public static String helloWorld() {
|
||||
return "Hello World";
|
||||
}
|
||||
}
|
||||
5
lib/src/main/kotlin/com/example/lib/MyLib.kt
Normal file
5
lib/src/main/kotlin/com/example/lib/MyLib.kt
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.example.lib
|
||||
|
||||
object MyLib {
|
||||
fun doOnMe() = print("hello")
|
||||
}
|
||||
@@ -1 +1,3 @@
|
||||
rootProject.name = "sample-modules"
|
||||
rootProject.name = "sample-modules"
|
||||
|
||||
include("demo", "lib")
|
||||
Reference in New Issue
Block a user