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

Useless "Multiple main classes" detected when running runMain #3739

Open
jrudolph opened this issue Nov 14, 2017 · 5 comments
Open

Useless "Multiple main classes" detected when running runMain #3739

jrudolph opened this issue Nov 14, 2017 · 5 comments

Comments

@jrudolph
Copy link
Member

jrudolph commented Nov 14, 2017

When using runMain a useless warning is printed to the console multiple times per run:

akka-http-tests > ~ test:runMain foobar.ReproduceAkkaBug
[info] Formatting 1 Scala source {file:/home/johannes/git/opensource/akka-http/}akka-http-tests(test) ...
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list
[info] Compiling 1 Scala source to /home/johannes/git/opensource/akka-http/akka-http-tests/target/scala-2.11/test-classes ...
[info] Done compiling.
[warn] Multiple main classes detected.  Run 'show discoveredMainClasses' to see the list

If you use runMain you are obviously aware of that fact.

sbt 1.0.3

@Blaisorblade
Copy link
Contributor

We also get the same warning constantly with dotty :-(

@eed3si9n eed3si9n added the uncategorized Used for Waffle integration label Sep 18, 2018
@agilesteel
Copy link

Any updates on this? I understand that it's not the most pressing issue in the world, but still...

@eed3si9n
Copy link
Member

Ref #1648 and #1669

sbt guesses main class for a package, but do not warn if there is more than one.

sbt should use some strategy to warn about the fact, like two lines above for selectRunMain

The warning was added intentionally. I guess we want the warning for run but not for runMain?

@eed3si9n
Copy link
Member

mainClass is still being detected for runMain potentially for two reasons:

  1. tab completion - 30e454a
  2. the other places mainClass shows up is during pakageBin, which is probably called by bgRunMain.

@kammoh
Copy link

kammoh commented Jul 8, 2020

Any updates on this issue? Are there at least any settings/flags to suppress this annoying and useless message?

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

No branches or pull requests

5 participants