Skip to content

Commit

Permalink
Add Automatic-Module-Name entry to jar manifest for interoperability …
Browse files Browse the repository at this point in the history
…with Project Jigsaw / Java 9 modules
  • Loading branch information
swaldman committed Feb 16, 2024
1 parent 331e715 commit 23d96e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
-- Add "Automatic-Module-Name" entry to jar manifest for interoperability with Project Jigsaw / Java 9 modules
See https://github.com/swaldman/c3p0/issues/171
Thanks Jörg Hohwiller
-- Try context ClassLoader if library ClassLoader fails to load a named, necessary driver class.
See https://github.com/swaldman/c3p0/pull/115
Thanks Rodrigo Merino!
Expand Down
7 changes: 6 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $meta._

import mill._
import mill.api.Result
import mill.api.{JarManifest,Result}
import mill.scalalib._
import mill.scalalib.publish._
import mill.util.Jvm
Expand Down Expand Up @@ -147,6 +147,11 @@ object c3p0 extends RootModule with JavaModule with PublishModule {
// but old JVMs that hit it wil generate NoSuchMethodError or similar at runtime
override def javacOptions = Seq("-source",JvmCompatVersion,"-target",JvmCompatVersion)

override def manifest = T {
val mainTups = JarManifest.MillDefault.main + Tuple2("Automatic-Module-Name","com.mchange.v2.c3p0")
JarManifest( main = mainTups )
}

object test extends JavaModule with TestModule.Junit5 {
override def moduleDeps = Seq(c3p0)

Expand Down

0 comments on commit 23d96e1

Please sign in to comment.