Skip to content

retronym/sbt-jpms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sbt-jpms

Download Build Status

Provides experimental support for JEP 261: Module System, by using the --module-path and related settings when compiling and executing tests/code from sub projects with this plugin enabled.

Caveats

  • Still under development, bugs are likely, and API will change.
  • Compiling module-info.java files in SBT is not supported until sbt/zinc#522 is included in a release
  • Forked mode is required
  • scalac support for for JPMS is still pending (but will be integrated here once available)

Usage

Adding plugin

// project/plugins.sbt
addSbtPlugin("com.lightbend.sbt" % "sbt-jpms" % "0.1.0")

Adding plugin settings to a subproject

val foo = project.enablePlugins(JpmsPlugin)

Configuring the module name for a scope

Compile and Test scopes use the same module name. This allows "whitebox testing", where tests can access non-exported packages. The plugin will add --patch-module, --add-reads and --add-modules as needed to make this work.

jpmsModuleName := Some("acme.foo")

Separate module name for tests

jpmsModuleName in Compile := Some("amce.foo")
jpmsModuleName in Compile := Some("amce.foo.tests")

Or

jpmsModuleName in Compile := Some("amce.foo")
jpmsModuleName in Compile := None // Will consume the module on the classpath

Associating Module Names with library dependencies

val junitJupiterApiDep = "org.junit.jupiter" % "junit-jupiter-api" % jupiterVersion % Test jpmsName "org.junit.jupiter.api"

Maintainer

This project is maintained by Jason Zaugg (Scala team, Lightbend, @retronym)

Contributing

Yes, pull requests and opening issues is very welcome!

Please test your changes using sbt scripted.

License

This plugin is released under the Apache 2.0 License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published