diff --git a/scalalib/src/mill/scalalib/JavaModule.scala b/scalalib/src/mill/scalalib/JavaModule.scala index 9da790b961e..a05e177843f 100644 --- a/scalalib/src/mill/scalalib/JavaModule.scala +++ b/scalalib/src/mill/scalalib/JavaModule.scala @@ -187,7 +187,7 @@ trait JavaModule extends mill.Module with TaskModule { outer => val files = for{ ref <- allSources() if exists(ref.path) - p <- ls.rec(ref.path) + p <- (if (ref.path.isDir) ls.rec(ref.path) else Seq(ref.path)) if p.isFile && (p.ext == "java") } yield p.toNIO.toString