Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt: disable testing in certain sub-modules

My project has several module, like

  • server (JVM)
  • sharedJVM
  • sharedJS
  • client (JS)

At the moment testing does only work for the JVM modules.

What I can do is:

sbt sharedJVM/test server/test

What I want do is:

sbt test

I couldn't find a Setting to do this.

like image 985
pme Avatar asked Aug 06 '26 06:08

pme


1 Answers

You can take advantage of aggregatedProjects as below:

lazy val aggregatedProjects: Seq[ProjectReference] = Seq(
  server,
  sharedJVM
)

lazy val root = project
  .in(file("."))
  .aggregate(aggregatedProjects: _*)

Once you do this, then whatever command you execute at root project level will be propagated to aggregated projects. Which means by running sbt test will execute sbt server/test and sbt sharedJVM/test

like image 65
Pritam Kadam Avatar answered Aug 07 '26 19:08

Pritam Kadam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!