If you use Quarkus with Scala and you get a java.lang.NoClassDefFoundError or java.lang.ClassNotFoundException when recompiling in development mode, try adding an explicit scala-compiler dependency to your POM:

  <dependencies>
    ...
    <dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-compiler</artifactId>
      <version>${scala.version}</version>
    </dependency>
    ...
  </dependencies>

This may help because Quarkus has an implicit dependency on a specific version of the compiler, which may not match the one that you are using in your project.

It worked for me, at least.

(I have since removed Scala from the MulkCMS 2 code base again as it only made the build time much longer without bringing in enough to make it worth it. Scala 3 might change that — we shall see.)