From 3ba832b0d5f37bde10741c52c7a8cd9dc4fc9944 Mon Sep 17 00:00:00 2001 From: usbharu <64310155+usbharu@users.noreply.github.com> Date: Sun, 18 Feb 2024 12:06:44 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=E3=83=A9=E3=82=A4=E3=82=BB=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E3=81=AE=E7=A2=BA=E8=AA=8D=E3=82=92=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- allowed-licenses.json | 25 +++++++ build.gradle.kts | 37 ++++++++-- license-list.xml | 126 +++++++++++++++++++++++++++++++++ license-normalizer-bundle.json | 56 +++++++++++++++ 4 files changed, 240 insertions(+), 4 deletions(-) create mode 100644 allowed-licenses.json create mode 100644 license-list.xml create mode 100644 license-normalizer-bundle.json diff --git a/allowed-licenses.json b/allowed-licenses.json new file mode 100644 index 00000000..64bcca39 --- /dev/null +++ b/allowed-licenses.json @@ -0,0 +1,25 @@ +{ + "allowedLicenses": [ + { + "moduleLicense": "Apache License, Version 2.0" + }, + { + "moduleLicense": "MIT License" + }, + { + "moduleLicense": "MIT-0" + }, + { + "moduleLicense": "The BSD License" + }, + { + "moduleLicense": "PUBLIC DOMAIN" + }, + { + "moduleLicense": "The 2-Clause BSD License" + }, + { + "moduleLicense": "GNU GENERAL PUBLIC LICENSE, Version 2 + Classpath Exception" + } + ] +} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 08a1c63e..bfeb3e18 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,8 @@ +import com.github.jk1.license.filter.DependencyFilter +import com.github.jk1.license.filter.LicenseBundleNormalizer +import com.github.jk1.license.importer.DependencyDataImporter +import com.github.jk1.license.importer.XmlReportImporter +import com.github.jk1.license.render.* import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import org.openapitools.generator.gradle.plugin.tasks.GenerateTask @@ -18,6 +23,8 @@ plugins { kotlin("plugin.spring") version "1.9.22" id("org.openapi.generator") version "7.2.0" id("org.jetbrains.kotlinx.kover") version "0.7.4" + id("com.github.jk1.dependency-license-report") version "2.5" + } apply { @@ -177,9 +184,8 @@ dependencies { implementation("io.ktor:ktor-serialization-jackson:$ktor_version") implementation("org.jetbrains.exposed:exposed-core:$exposed_version") implementation("org.jetbrains.exposed:exposed-jdbc:$exposed_version") - implementation("com.h2database:h2:$h2_version") + developmentOnly("com.h2database:h2:$h2_version") implementation("org.xerial:sqlite-jdbc:3.45.1.0") - implementation("ch.qos.logback:logback-classic:$logback_version") implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version") implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version") @@ -190,8 +196,9 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-thymeleaf") implementation("org.springframework.boot:spring-boot-starter-oauth2-authorization-server") implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server") - implementation("jakarta.validation:jakarta.validation-api") - implementation("jakarta.annotation:jakarta.annotation-api:2.1.0") + implementation("org.springframework.boot:spring-boot-starter-log4j2") + compileOnly("jakarta.validation:jakarta.validation-api") + compileOnly("jakarta.annotation:jakarta.annotation-api:2.1.0") compileOnly("io.swagger.core.v3:swagger-annotations:2.2.6") implementation("io.swagger.core.v3:swagger-models:2.2.6") implementation("org.jetbrains.exposed:exposed-java-time:$exposed_version") @@ -304,6 +311,12 @@ configurations.matching { it.name == "detekt" }.all { } } +configurations { + all { + exclude("org.springframework.boot", "spring-boot-starter-logging") + } +} + project.gradle.taskGraph.whenReady { println(this.allTasks) this.allTasks.map { println(it.name) } @@ -347,3 +360,19 @@ koverReport { springBoot { buildInfo() } + +licenseReport { + + excludeOwnGroup = true + + importers = arrayOf(XmlReportImporter("hideout", File("$projectDir/license-list.xml"))) + renderers = arrayOf( + InventoryHtmlReportRenderer(), + CsvReportRenderer(), + JsonReportRenderer(), + XmlReportRenderer() + ) + filters = arrayOf(LicenseBundleNormalizer("$projectDir/license-normalizer-bundle.json", true)) + allowedLicensesFile = File("$projectDir/allowed-licenses.json") + configurations = arrayOf("productionRuntimeClasspath") +} \ No newline at end of file diff --git a/license-list.xml b/license-list.xml new file mode 100644 index 00000000..985f9bd9 --- /dev/null +++ b/license-list.xml @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProjectVersionLicense
com.fasterxml.jackson:jackson-bom2.15.3Apache License, Version 2.0
io.ktor:ktor-client-cio2.3.8Apache License, Version 2.0
io.ktor:ktor-client-content-negotiation2.3.8Apache License, Version 2.0
io.ktor:ktor-client-core2.3.8Apache License, Version 2.0
io.ktor:ktor-events2.3.8Apache License, Version 2.0
io.ktor:ktor-http2.3.8Apache License, Version 2.0
io.ktor:ktor-http-cio2.3.8Apache License, Version 2.0
io.ktor:ktor-io2.3.8Apache License, Version 2.0
io.ktor:ktor-network2.3.8Apache License, Version 2.0
io.ktor:ktor-network-tls2.3.8Apache License, Version 2.0
io.ktor:ktor-serialization2.3.8Apache License, Version 2.0
io.ktor:ktor-serialization-jackson2.3.8Apache License, Version 2.0
io.ktor:ktor-utils2.3.8Apache License, Version 2.0
io.ktor:ktor-websocket-serialization2.3.8Apache License, Version 2.0
io.ktor:ktor-websockets2.3.8Apache License, Version 2.0
org.apache.tika:tika-parsers2.9.1Apache License, Version 2.0
org.jetbrains.kotlin:kotlin-stdlib-common1.9.22Apache License, Version 2.0
org.jetbrains.kotlinx:kotlinx-coroutines-bom1.7.3Apache License, Version 2.0
org.jetbrains.kotlinx:kotlinx-coroutines-core1.7.3Apache License, Version 2.0
org.jetbrains.kotlinx:kotlinx-serialization-bom1.6.2Apache License, Version 2.0
org.jetbrains.kotlinx:kotlinx-serialization-core1.6.2Apache License, Version 2.0
org.jetbrains.kotlinx:kotlinx-serialization-json1.6.2Apache License, Version 2.0
+
+
+
\ No newline at end of file diff --git a/license-normalizer-bundle.json b/license-normalizer-bundle.json new file mode 100644 index 00000000..fe85ed5f --- /dev/null +++ b/license-normalizer-bundle.json @@ -0,0 +1,56 @@ +{ + "bundles": [ + { + "bundleName": "Apache-2.0", + "licenseName": "Apache License, Version 2.0", + "licenseUrl": "https://www.apache.org/licenses/LICENSE-2.0.txt" + }, + { + "bundleName": "EPL-1.0", + "licenseName": "Eclipse Public License - v 1.0", + "licenseUrl": "http://www.eclipse.org/legal/epl-v10.html" + } + ], + "transformationRules": [ + { + "bundleName": "Apache-2.0", + "licenseNamePattern": ".*The Apache Software License, Version 2.0.*" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": "Apache 2" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": "http://www.apache.org/licenses/LICENSE-2.0.txt" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": "https://www.apache.org/licenses/LICENSE-2.0" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": "https://aws.amazon.com/apache2.0" + }, + { + "bundleName": "Apache-2.0", + "licenseUrlPattern": "https://www.apache.org/licenses/LICENSE-2.0.txt" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": "Special Apache" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": "Keep this name" + }, + { + "bundleName": "Apache-2.0", + "licenseNamePattern": "The Apache Software License, Version 2.0" + }, + { + "bundleName": "EPL-1.0", + "licenseNamePattern": "EPL 1.0" + } + ] +} \ No newline at end of file