question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multimodule project fail

See original GitHub issue

I have a multimodule project. When adding the plugin it fails to run scalafmt with ClassNotFoundException:

Caused by: java.lang.ClassNotFoundException: scala.Product$class
        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
        at com.lucidchart.sbt.scalafmt.ScalafmtClassLoader.findClass(ScalafmtClassLoader.scala:13)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at org.scalafmt.Versions$.<init>(Versions.scala:6)
        at org.scalafmt.Versions$.<clinit>(Versions.scala)
        at org.scalafmt.config.ScalafmtConfig$.apply$default$1(ScalafmtConfig.scala:2)
        at org.scalafmt.config.Settings$class.$init$(Settings.scala:20)
        at org.scalafmt.config.ScalafmtConfig$.<init>(ScalafmtConfig.scala:49)
        at org.scalafmt.config.ScalafmtConfig$.<clinit>(ScalafmtConfig.scala)
        at org.scalafmt.config.Config$.fromHocon(Config.scala:42)
        at org.scalafmt.config.Config.fromHocon(Config.scala)
        at com.lucidchart.scalafmt.impl.Scalafmtter.config(Scalafmtter.java:12)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7.config$lzycompute$1(ScalafmtCorePlugin.scala:74)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7.com$lucidchart$sbt$scalafmt$ScalafmtCorePlugin$autoImport$$anonfun$$config$1(ScalafmtCorePlugin.scala:74)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7$$anonfun$12$$anonfun$apply$7.apply(ScalafmtCorePlugin.scala:76)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7$$anonfun$12$$anonfun$apply$7.apply(ScalafmtCorePlugin.scala:75)
        at scala.util.Either$LeftProjection.flatMap(Either.scala:364)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7$$anonfun$12.apply(ScalafmtCorePlugin.scala:75)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7$$anonfun$12.apply(ScalafmtCorePlugin.scala:75)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7.apply(ScalafmtCorePlugin.scala:75)
        at com.lucidchart.sbt.scalafmt.ScalafmtCorePlugin$autoImport$$anonfun$7.apply(ScalafmtCorePlugin.scala:36)

Each module has:

  .enablePlugins(ScalafmtPlugin)

And I am using the sbt-coursier plugin as well.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
2mcommented, Jun 16, 2017

Thanks for the fix. "sbt-scalafmt-coursier" % "1.3" works for me for single and multi module projects and also when using and when not using coursier.

0reactions
2mcommented, Jun 15, 2017

I noticed this error on a single module projects as well (https://github.com/2m/kabrioletas)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does a Maven 3 multi-module project fail on "clean ...
When I run mvn clean compile followed by mvn package in the root , it runs through without issue. It always fails at...
Read more >
multi-module projects fail when using configuration-matching
Problem Using this command snyk -d --all-sub-projects --configuration-matching=^runtimeClasspath$ test For example in a multi project like ...
Read more >
Guide to Working with Multiple Modules - Apache Maven
This section outlines how Maven processes projects with multiple modules, and how you can work with them more effectively. The Reactor. The mechanism...
Read more >
update of maven multi module project failed loaded from git
When I change git branch and force update maven project, everything is updated except one project using web service project. I find out...
Read more >
Unable to correctly import multi module maven project
Unable to correctly import multi module maven project. OS: Mac OS Version: JetBrains IntelliJ CE 2020.3. Problem Description:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found