how to set main class in SBT 0.13 project

后端 未结 9 717
旧时难觅i
旧时难觅i 2020-12-23 18:58

Could you guys please explain to me how to set main class in SBT project ? I\'m trying to use version 0.13.

My directory structure is very simple (unlike SBT\'s docu

9条回答
  •  别那么骄傲
    2020-12-23 19:16

    I had the same issue. Resolved it after adding PlayMinimalJava plugin in build.sbt.

    Not sure how it got fixed, if someone can highlight how PlayMinimalJava solves it, would be great.

    enablePlugins(PlayMinimalJava)
    

    My build.sbt looks like this

    organization := "org"
    version := "1.0-SNAPSHOT"
    scalaVersion := "2.13.1"
    libraryDependencies += guice
    enablePlugins(PlayMinimalJava)
    

    Log

    C:\Users\KulwantSingh\repository\pdfdemo>sbt run
    Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
    [info] Loading settings for project pdfdemo-build from plugins.sbt ...
    [info] Loading project definition from C:\Users\KulwantSingh\repository\pdfdemo\project
    [info] Loading settings for project pdfdemo from build.sbt ...
    [info] Set current project to pdfdemo (in build file:/C:/Users/KulwantSingh/repository/pdfdemo/)
    [warn] There may be incompatibilities among your library dependencies; run 'evicted' to see detailed eviction warnings.
    
    --- (Running the application, auto-reloading is enabled) ---
    
    [info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
    
    (Server started, use Enter to stop and go back to the console...)
    
    [info] Compiling 6 Scala sources and 2 Java sources to C:\Users\KulwantSingh\repository\pdfdemo\target\scala-2.13\classes ...
    [info] p.a.h.EnabledFilters - Enabled Filters (see ):
    
        play.filters.csrf.CSRFFilter
        play.filters.headers.SecurityHeadersFilter
        play.filters.hosts.AllowedHostsFilter
    
    [info] play.api.Play - Application started (Dev) (no global state)
    

提交回复
热议问题