Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the plugin causes main class detection to fail #2

Open
taig opened this issue Mar 20, 2018 · 1 comment
Open

Adding the plugin causes main class detection to fail #2

taig opened this issue Mar 20, 2018 · 1 comment

Comments

@taig
Copy link

taig commented Mar 20, 2018

project/build.properties (same issue with 0.13.17):

sbt.version=1.1.1

project/plugins.sbt:

addSbtPlugin("eu.sipria.sbt" % "sbt-closure" % "1.1.0")

build.sbt:

enablePlugins(SbtWeb)

src/main/scala/com/example/Main.scala:

package com.example

object Main {
  def main(args: Array[String]): Unit = {}
}
> sbt run
[info] Loading settings from plugins.sbt ...
[info] Loading global plugins from ~/.sbt/1.0/plugins/
[info] Loading settings from plugins.sbt ...
[info] Loading project definition from ./project/
[info] Loading settings from build.sbt ...
[info] Set current project to playground
[info] Packaging ./target/scala-2.12/playground_2.12-0.1.0-SNAPSHOT.jar ...
[info] Done packaging.
[error] java.lang.RuntimeException: No main class detected.
[error] 	at scala.sys.package$.error(package.scala:27)
[error] 	at sbt.Defaults$.$anonfun$bgRunTask$4(Defaults.scala:1163)
[error] 	at scala.Option.getOrElse(Option.scala:121)
[error] 	at sbt.Defaults$.$anonfun$bgRunTask$3(Defaults.scala:1163)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:39)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:66)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:262)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:271)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:262)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:174)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:36)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[error] 	at java.lang.Thread.run(Thread.java:745)
[error] (Compile / bgRun) No main class detected.
[error] Total time: 0 s, completed Mar 20, 2018 5:08:35 PM
[INFO] [03/20/2018 17:08:35.583] [Thread-2] [CoordinatedShutdown(akka://sbt-web)] Starting coordinated shutdown from JVM shutdown hook

This only happens when the addSbtPlugin("eu.sipria.sbt" % "sbt-closure" % "1.1.0") dependency is present. If commented out and replaced with addSbtPlugin("com.typesafe.sbt" %% "sbt-web" % "1.4.3") everything works as expected.

@taig
Copy link
Author

taig commented Mar 20, 2018

This might be due to the definition of include- and excludeFilter lacking the in closure scoping. But that's just a wild guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant