You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by "mdedetrich (via GitHub)" <gi...@apache.org> on 2023/05/16 07:17:12 UTC

[GitHub] [incubator-pekko-http] mdedetrich commented on a diff in pull request #147: Integrate sbt-license-report

mdedetrich commented on code in PR #147:
URL: https://github.com/apache/incubator-pekko-http/pull/147#discussion_r1194719727


##########
project/LicenseReport.scala:
##########
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * license agreements; and to You under the Apache License, version 2.0:
+ *
+ *   https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * This file is part of the Apache Pekko project, derived from Akka.
+ */
+
+import sbt._
+import sbtlicensereport.SbtLicenseReport
+import sbtlicensereport.SbtLicenseReport.autoImportImpl._
+import sbtlicensereport.license.{ DepModuleInfo, LicenseInfo, MarkDown }
+
+object LicenseReport extends AutoPlugin {
+
+  override lazy val projectSettings = Seq(
+    licenseReportTypes := Seq(MarkDown),
+    licenseReportMakeHeader := (language => language.header1("License Report")),
+    licenseConfigurations := Set("compile", "test", "provided"),
+    licenseDepExclusions := {
+      case DepModuleInfo("org.apache.pekko", _, _) => true // Inter pekko project dependencies are pointless
+      case DepModuleInfo(_, "scala-library", _)    => true // Scala library is part of Scala language
+      case DepModuleInfo(_, "scala-reflect", _)    => true // Scala reflect is part of Scala language
+    },
+    licenseOverrides := {
+      // H2spec is added directly by URI which is why it cannot resolve license information from Maven.
+      // License can be found at https://github.com/summerwind/h2spec/blob/master/LICENSE
+      case dep: DepModuleInfo if dep.name.toLowerCase.contains("h2spec") => LicenseInfo.MIT

Review Comment:
   This is necessary due to the fact that h2spec is being added as a direct URI dependency, see https://github.com/apache/incubator-pekko-http/blob/54c9b20c48b02b9c62fc903984c09a92bbc6a12b/project/Dependencies.scala#L88



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@pekko.apache.org
For additional commands, e-mail: notifications-help@pekko.apache.org