Skip to content

Commit

Permalink
Fix CDDL + GPL with classpath LicenseCategory
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Jul 30, 2023
1 parent 21ec415 commit 8d43055
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions src/main/scala/sbtlicensereport/license/LicenseCategory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ object LicenseCategory {
name.contains("classpath")
}
}
object CDDLPlusGPLClasspath extends LicenseCategory("CDDL + GPLv2 with classpath exception") {
override def unapply(license: String): Boolean = {
val name = license.toLowerCase
(name.contains("gpl") || name.contains("general public license")) &&
(name.contains("cddl") || name.contains("common development and distribution license")) &&
name.contains("classpath")
}
}
val GPL = LicenseCategory("GPL", Seq("general public license"))
val Mozilla = LicenseCategory("Mozilla", Seq("mpl"))
val MIT = LicenseCategory("MIT")
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/sbtlicensereport/license/LicenseInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ object LicenseInfo {
"http://opensource.org/licenses/CDDL-1.0"
)
val CDDL_GPL = LicenseInfo(
LicenseCategory.CDDL,
"CDDL + GPLv2 License",
"https://glassfish.dev.java.net/nonav/public/CDDL+GPL.html"
LicenseCategory.CDDLPlusGPLClasspath,
"CDDL + GPLv2 with classpath exception",
"https://oss.oracle.com/licenses/CDDL+GPL-1.1"
)
val APACHE2 = LicenseInfo(
LicenseCategory.Apache,
Expand Down

0 comments on commit 8d43055

Please sign in to comment.