diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 6795275..0000000 --- a/build.gradle +++ /dev/null @@ -1,160 +0,0 @@ -import org.springframework.boot.gradle.plugin.SpringBootPlugin - -buildscript { - repositories { - mavenCentral() - mavenLocal() - maven { - url "https://repo.spring.io/milestone/" - } - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") - } -} - -allprojects { - group = "com.navercorp.spring" - version = "3.3.0-SNAPSHOT" -} - -subprojects { - apply plugin: "java" - apply plugin: "java-library" - apply plugin: "idea" - apply plugin: "checkstyle" - apply plugin: "io.spring.dependency-management" - apply plugin: "maven-publish" - apply plugin: "signing" - - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - - repositories { - mavenCentral() - maven { - url "https://repo.spring.io/milestone/" - } - } - - dependencies { - compileOnly("com.google.code.findbugs:jsr305:3.0.2") - testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") - } - - dependencyManagement { - imports { - mavenBom("${SpringBootPlugin.BOM_COORDINATES}") { - bomProperties([ - 'spring-data-bom.version': "${springDataBomVersion}" - ]) - } - } - } - - checkstyle { - configFile = file("${project.rootDir}/rule/naver-checkstyle-rules.xml") - configProperties = ["suppressionFile": "${project.rootDir}/tool/naver-checkstyle-suppressions.xml"] - toolVersion = "9.1" - ignoreFailures = true // TODO: return to false - maxErrors = 0 - maxWarnings = 0 - } - - test { - useJUnitPlatform() - } - - tasks.withType(Javadoc).all { enabled = false } - tasks.withType(JavaCompile).configureEach { - options.compilerArgs << '-parameters' - } - - java { - withJavadocJar() - withSourcesJar() - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } - - publishing { - publications { - mavenJava(MavenPublication) { - from components.java - - repositories { - maven { - def ossrhUsername = project.hasProperty("ossrhUsername") ? ossrhUsername : "" - def ossrhPassword = project.hasProperty("ossrhPassword") ? ossrhPassword : "" - - credentials { - username ossrhUsername - password ossrhPassword - } - - def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" - def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" - url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl - } - } - - versionMapping { - usage('java-api') { - fromResolutionOf('runtimeClasspath') - } - usage('java-runtime') { - fromResolutionResult() - } - } - - pom { - name = "Spring JDBC Plus" - description = "Spring JDBC Plus" - url = "http://github.com/naver/spring-jdbc-plus" - licenses { - license { - name = "The Apache License, Version 2.0" - url = "http://www.apache.org/licenses/LICENSE-2.0.txt" - } - } - developers { - developer { - id = "mhyeon-lee" - name = "Myeonghyeon Lee" - email = "mheyon.lee@gmail.com" - } - developer { - id = "yd-2" - name = "Youngdae Lee" - email = "yd.2@navercorp.com" - } - developer { - id = "chanhyeong" - name = "Chanhyeong Cho" - email = "chu7825@gmail.com" - } - developer { - id = "wool0826" - name = "Chanwool Jo" - email = "chanwool94@gmail.com" - } - } - scm { - connection = "scm:git:git://github.com/naver/spring-jdbc-plus.git" - developerConnection = "scm:git:git://github.com/naver/spring-jdbc-plus.git" - url = "https://github.com/naver/spring-jdbc-plus" - } - } - } - } - } - - - signing { - sign publishing.publications.mavenJava - } - - tasks.withType(Sign) { - onlyIf { !version.endsWith("SNAPSHOT") } - } -} diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle new file mode 100644 index 0000000..1b83ba9 --- /dev/null +++ b/buildSrc/build.gradle @@ -0,0 +1,16 @@ +plugins { + id "groovy-gradle-plugin" +} + +repositories { + mavenLocal() + mavenCentral() + gradlePluginPortal() // give access to gradle community plugins + maven { + url "https://repo.spring.io/milestone/" + } +} + +dependencies { + implementation "io.spring.gradle:dependency-management-plugin:1.1.5" +} diff --git a/buildSrc/src/main/groovy/spring.jdbc.plus.java-conventions.gradle b/buildSrc/src/main/groovy/spring.jdbc.plus.java-conventions.gradle new file mode 100644 index 0000000..e96c3d5 --- /dev/null +++ b/buildSrc/src/main/groovy/spring.jdbc.plus.java-conventions.gradle @@ -0,0 +1,36 @@ +plugins { + id "java-library" + id "checkstyle" + id "idea" +} + +java { + withJavadocJar() + withSourcesJar() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} + +tasks.withType(Javadoc).configureEach { enabled = false } + +tasks.withType(JavaCompile).configureEach { + options.compilerArgs << '-parameters' +} + +test { + useJUnitPlatform() +} + +checkstyle { + configFile = file("${project.rootDir}/rule/naver-checkstyle-rules.xml") + configProperties = ["suppressionFile": "${project.rootDir}/tool/naver-checkstyle-suppressions.xml"] + toolVersion = "9.1" + ignoreFailures = true // TODO: return to false + maxErrors = 0 + maxWarnings = 0 +} + +dependencies { + compileOnly("com.google.code.findbugs:jsr305:3.0.2") + testCompileOnly("com.google.code.findbugs:jsr305:3.0.2") +} diff --git a/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle b/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle new file mode 100644 index 0000000..c93166f --- /dev/null +++ b/buildSrc/src/main/groovy/spring.jdbc.plus.maven-publish-conventions.gradle @@ -0,0 +1,87 @@ +plugins { + id "maven-publish" + id "signing" +} + +group = "com.navercorp.spring" +version = "3.3.0-SNAPSHOT" + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + + repositories { + maven { + def ossrhUsername = project.hasProperty("ossrhUsername") ? ossrhUsername : "" + def ossrhPassword = project.hasProperty("ossrhPassword") ? ossrhPassword : "" + + credentials { + username ossrhUsername + password ossrhPassword + } + + def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl + } + } + + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } + } + + pom { + name = "Spring JDBC Plus" + description = "Spring JDBC Plus" + url = "http://github.com/naver/spring-jdbc-plus" + licenses { + license { + name = "The Apache License, Version 2.0" + url = "http://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + developers { + developer { + id = "mhyeon-lee" + name = "Myeonghyeon Lee" + email = "mheyon.lee@gmail.com" + } + developer { + id = "yd-2" + name = "Youngdae Lee" + email = "yd.2@navercorp.com" + } + developer { + id = "chanhyeong" + name = "Chanhyeong Cho" + email = "chu7825@gmail.com" + } + developer { + id = "wool0826" + name = "Chanwool Jo" + email = "chanwool94@gmail.com" + } + } + scm { + connection = "scm:git:git://github.com/naver/spring-jdbc-plus.git" + developerConnection = "scm:git:git://github.com/naver/spring-jdbc-plus.git" + url = "https://github.com/naver/spring-jdbc-plus" + } + } + } + } +} + +signing { + sign publishing.publications.mavenJava +} + +tasks.withType(Sign) { + onlyIf { !version.endsWith("SNAPSHOT") } +} diff --git a/buildSrc/src/main/groovy/spring.jdbc.plus.spring-bom-conventions.gradle b/buildSrc/src/main/groovy/spring.jdbc.plus.spring-bom-conventions.gradle new file mode 100644 index 0000000..a6b28b7 --- /dev/null +++ b/buildSrc/src/main/groovy/spring.jdbc.plus.spring-bom-conventions.gradle @@ -0,0 +1,13 @@ +plugins { + id "io.spring.dependency-management" +} + +dependencyManagement { + imports { + mavenBom("org.springframework.boot:spring-boot-dependencies:${springBootVersion}") { + bomProperties([ + "spring-data-bom.version": "${springDataBomVersion}" + ]) + } + } +} diff --git a/gradle.properties b/gradle.properties index a5932b3..dfa1a26 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,2 @@ springBootVersion=3.3.0-RC1 springDataBomVersion=2024.0.0-RC1 -kotlinVersion=1.9.20 diff --git a/guide-projects/plus-repository-guide/build.gradle b/guide-projects/plus-repository-guide/build.gradle index 00988e0..964af24 100644 --- a/guide-projects/plus-repository-guide/build.gradle +++ b/guide-projects/plus-repository-guide/build.gradle @@ -1,3 +1,8 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" +} + dependencies { implementation project(':spring-boot-starter-data-jdbc-plus-repository') diff --git a/guide-projects/plus-sql-java-groovy-guide/build.gradle b/guide-projects/plus-sql-java-groovy-guide/build.gradle index 3b599fc..27c5b67 100644 --- a/guide-projects/plus-sql-java-groovy-guide/build.gradle +++ b/guide-projects/plus-sql-java-groovy-guide/build.gradle @@ -1,12 +1,9 @@ plugins { - id "java" + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" id "groovy" } -repositories { - mavenCentral() -} - compileGroovy { options.encoding = "UTF-8" groovyOptions.encoding = "UTF-8" diff --git a/guide-projects/plus-sql-java-kotlin-guide/build.gradle b/guide-projects/plus-sql-java-kotlin-guide/build.gradle index cfcd22c..e1fe3d8 100644 --- a/guide-projects/plus-sql-java-kotlin-guide/build.gradle +++ b/guide-projects/plus-sql-java-kotlin-guide/build.gradle @@ -1,17 +1,7 @@ -buildscript { - repositories { - mavenCentral() - } - dependencies { - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}") - } -} - -apply plugin: "java" -apply plugin: "kotlin" - -repositories { - mavenCentral() +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "org.jetbrains.kotlin.jvm" version "1.9.20" } compileKotlin { @@ -21,6 +11,7 @@ compileKotlin { jvmTarget = "17" } } + compileTestKotlin { kotlinOptions { javaParameters = true diff --git a/guide-projects/plus-sql-kotlin-guide/build.gradle.kts b/guide-projects/plus-sql-kotlin-guide/build.gradle.kts index cfb773e..c3ec645 100644 --- a/guide-projects/plus-sql-kotlin-guide/build.gradle.kts +++ b/guide-projects/plus-sql-kotlin-guide/build.gradle.kts @@ -1,28 +1,18 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -buildscript { - repositories { - maven(url = "https://plugins.gradle.org/m2/") - } - dependencies { - classpath("org.jlleitschuh.gradle:ktlint-gradle:10.2.0") - } -} - plugins { - val kotlinVersion = "1.9.20" - + id("spring.jdbc.plus.spring-bom-conventions") id("org.jlleitschuh.gradle.ktlint") version "10.2.0" - kotlin("jvm") version kotlinVersion - kotlin("plugin.spring") version kotlinVersion + kotlin("jvm") version "1.9.20" + kotlin("plugin.spring") version "1.9.20" } -repositories { - mavenCentral() +tasks.withType { + kotlinOptions.jvmTarget = "17" + kotlinOptions.javaParameters = true } dependencies { - implementation("org.springframework.boot:spring-boot-starter-web") implementation(project(":spring-boot-starter-data-jdbc-plus-sql")) implementation("org.springframework.boot:spring-boot-starter-actuator") @@ -36,8 +26,3 @@ dependencies { testImplementation("org.springframework.boot:spring-boot-starter-test") } - -tasks.withType { - kotlinOptions.jvmTarget = "17" - kotlinOptions.javaParameters = true -} diff --git a/settings.gradle b/settings.gradle index fe663b3..2e79688 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,12 @@ +dependencyResolutionManagement { + repositories { + mavenCentral() + maven { + url "https://repo.spring.io/milestone/" + } + } +} + rootProject.name = "spring-jdbc-plus" include "spring-jdbc-plus-commons" diff --git a/spring-boot-autoconfigure-data-jdbc-plus/build.gradle b/spring-boot-autoconfigure-data-jdbc-plus/build.gradle index 773f36e..aa1db4b 100644 --- a/spring-boot-autoconfigure-data-jdbc-plus/build.gradle +++ b/spring-boot-autoconfigure-data-jdbc-plus/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + compileJava.dependsOn(processResources) dependencies { diff --git a/spring-boot-starter-data-jdbc-plus-repository/build.gradle b/spring-boot-starter-data-jdbc-plus-repository/build.gradle index 0830163..08a0e41 100644 --- a/spring-boot-starter-data-jdbc-plus-repository/build.gradle +++ b/spring-boot-starter-data-jdbc-plus-repository/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + dependencies { api(project(":spring-data-jdbc-plus-repository")) api(project(":spring-boot-autoconfigure-data-jdbc-plus")) diff --git a/spring-boot-starter-data-jdbc-plus-sql/build.gradle b/spring-boot-starter-data-jdbc-plus-sql/build.gradle index 0b6a5f2..45b31ba 100644 --- a/spring-boot-starter-data-jdbc-plus-sql/build.gradle +++ b/spring-boot-starter-data-jdbc-plus-sql/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + dependencies { api(project(":spring-boot-autoconfigure-data-jdbc-plus")) api(project(":spring-data-jdbc-plus-sql")) diff --git a/spring-data-jdbc-plus-repository/build.gradle b/spring-data-jdbc-plus-repository/build.gradle index 814a29a..68f8591 100644 --- a/spring-data-jdbc-plus-repository/build.gradle +++ b/spring-data-jdbc-plus-repository/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + compileJava.dependsOn(processResources) dependencies { diff --git a/spring-data-jdbc-plus-sql/build.gradle b/spring-data-jdbc-plus-sql/build.gradle index 21b7d5d..7ea4485 100644 --- a/spring-data-jdbc-plus-sql/build.gradle +++ b/spring-data-jdbc-plus-sql/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + compileJava.dependsOn(processResources) dependencies { diff --git a/spring-data-jdbc-plus-support/build.gradle b/spring-data-jdbc-plus-support/build.gradle index 2b14b14..f582f61 100644 --- a/spring-data-jdbc-plus-support/build.gradle +++ b/spring-data-jdbc-plus-support/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + compileJava.dependsOn(processResources) dependencies { diff --git a/spring-data-plus-sql-gen/build.gradle b/spring-data-plus-sql-gen/build.gradle index e6c878f..ae334bb 100644 --- a/spring-data-plus-sql-gen/build.gradle +++ b/spring-data-plus-sql-gen/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + dependencies { api(project(":spring-data-jdbc-plus-sql")) diff --git a/spring-jdbc-plus-commons/build.gradle b/spring-jdbc-plus-commons/build.gradle index 9e2969a..5980f60 100644 --- a/spring-jdbc-plus-commons/build.gradle +++ b/spring-jdbc-plus-commons/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + compileJava.dependsOn(processResources) dependencies { diff --git a/spring-jdbc-plus-support/build.gradle b/spring-jdbc-plus-support/build.gradle index f3a3ffd..71ca3fa 100644 --- a/spring-jdbc-plus-support/build.gradle +++ b/spring-jdbc-plus-support/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "spring.jdbc.plus.java-conventions" + id "spring.jdbc.plus.spring-bom-conventions" + id "spring.jdbc.plus.maven-publish-conventions" +} + dependencies { api("org.springframework:spring-jdbc")