2017-10-25 3 views
0

プレイ(フレームワーク)内のサブプロジェクト(管理エリア)をコンパイルのでthis documentationを使用してきたが、午前私は修正することはできませんコンパイルエラーを考え出す:に成功しました私はセットアップするために管理エリアをサブプロジェクトとして<strong><em>にフレームワーク</em></strong>(2.6)を再生したい

[エラー] ...のconf \ルート:15:見つかりません:値管理

[エラー] - >/adminに管理。経路

main-project 
    _build.sbt 
    _app 
    _controllers 
    _models 
    _views 
    _conf 
    _application.conf 
    _routes 
    _modules 
    _admin 
     _build.sbt 
     _app 
     _controllers 
     _models 
     _views 
     _conf 
     _admin.routes 
    _project 
    _build.properties 
    _plugins.sbt 

メイン・プロジェクト/ build.sbt

import play.sbt.routes.RoutesKeys 

    name := "main-project" 

    val defaultResolvers = Seq(
    Resolver.sonatypeRepo("snapshots") 
    ) 

    lazy val commonSettings = Seq(
    organization := "com.boardrs", 
    version := "1.0-SNAPSHOT", 
    scalaVersion := "2.12.2", 
    scalacOptions ++= Seq("-feature", "-language:postfixOps"), 
    resolvers ++= defaultResolvers 
    ) 


    lazy val admin = (project in file("modules/admin")) 
    .settings(
     commonSettings 
    ).enablePlugins(PlayScala) 

    lazy val root = (project in file(".")) 
    .settings(
     commonSettings 
    ) 
    .enablePlugins(PlayScala) 


    routesGenerator := InjectedRoutesGenerator 
    RoutesKeys.routesImport += "play.modules.reactivemongo.PathBindables._" 

    libraryDependencies += guice 
    libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "3.0.0" % Test 
    libraryDependencies += "com.h2database" % "h2" % "1.4.194" 
    libraryDependencies += "com.typesafe.play" %% "play-json" % "2.6.0" 
    libraryDependencies += ws 

    // Play 2.6.x 
    libraryDependencies ++= Seq(
    "org.reactivemongo" %% "play2-reactivemongo" % "0.12.5-play26" 
    ) 


    libraryDependencies += "org.webjars" % "bootstrap" % "3.1.1-2" 

メイン・プロジェクト/モジュール/管理/ build.sbt

name := "admin" 

PlayKeys.devSettings += "play.http.router" -> "admin.Routes" 
:これは私の プロジェクト構造です

メインプロジェクト/ conf/routes私がスタックに(ここでは慎重に見てきました(エラーで参照行を含むファイル)

 # home page 
     GET /     controllers.HomeController.index 

     -> /admin admin.Routes 

     GET  /assets/*file  controllers.Assets.at(path="/public", file) 

メイン・プロジェクト/モジュール/管理/ confに/ admin.routes

GET /index     controllers.admin.HomeController.index() 

    GET /assets/*file   controllers.admin.Assets.versioned(path="/public/lib/admin", file) 

オーバーフローなど)、ソリューションの場合は別の場所、たとえばthis questionは非常によく似ていますが、その答えは非難されている技術を取り入れています。私は複数の組み合わせを試しましたが、Play Frameworkは繊細な獣です。多くの設定や互換性の問題が発生する可能性があるため、私自身が答えを磨いているかのようには感じません。誰も私ができないものを見ることができますか?おかげで、あなたのメイン・プロジェクト/ build.sbtで

答えて

0

は変更してみてください:

lazy val admin = (project in file("modules/admin")) 

lazy val admin = (project in file("admin")) 

を私はあなたがDEPENDSONとaggregateOnが欠けていると思いますあなたの主要なsbtのルートプロジェクトのために。

は変更してみてください:

lazy val root = (project in file(".")) 
.settings(
    commonSettings 
) 
.enablePlugins(PlayScala) 

lazy val root = (project in file(".")) 
.settings(
    commonSettings 
) 
.enablePlugins(PlayScala).dependsOn(admin).aggregate(admin) 
+0

に良い場所だが、それはエラーをクリアしていないこと。それ以外は新鮮な目で見えませんか? –

+0

私はあなたのメインのsbtのルートプロジェクトのdependsOnとaggregateOnが不足していると思います。 –

関連する問題

 関連する問題