-
Notifications
You must be signed in to change notification settings - Fork 443
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
default mainClass not picked up #568
Comments
Setting the mainClass like this? mainClass in Compile := Some("foo.bar.Main"), If this doesn't help, can you provide a small example project demonstrating the issue? |
Ok, now I feel stupid. Just tried this and it works. Maybe something to add to the docs? |
no problem ;) actually you used the most specific configuration possible. SBT beginners normally don't know this. Configuring on Configuration and Task axis. What are you trying to achieve? Normally you should have one entry point in your application. If you have different application, splitting them up in submodules is usually the best way as sbt configures most of the stuff itself. However a small section on Advanced Topics wouldn't hurt. Do you have time for a small pull request on the topic? |
In fact the second main class in my application was inherited from some library. I do have multiple modules with each it's own java app / server and if I remember correctly I had a problem with the sbt-revolver plugin in the past and as a solution for that I added the (Compile, run) Anyway it all works perfectly now. I'll submit a small patch for the docs. No need for a advanced topic? |
updated docs related to #568 on multiple main classes
awesome :) |
oops, there's a typo, produces instead of produced |
My module has multiple classes containing a main method. The documentation mentions this:
This archetype will use the mainClass setting of sbt (automatically discovers your main class)
So I tried all kinds of things like:
The first one works for
run
andre-start
but the packager is not picking up the default main class. The binaries are missing and I always get this logged:Multiple main classes detected. Run 'show discoveredMainClasses' to see the list
(I'm using a multi-module build, this module is has
enablePlugins(JavaAppPackaging)
)The text was updated successfully, but these errors were encountered: