build.sbt defining project dependency between modules

浪子不回头ぞ 提交于 2020-01-02 10:22:54

问题


I have project in PlayFramework. It has one main project without any code/logic. And it have few submodules:

  • main:
    • admin
    • common
    • shop

Modules: admin and shop will base on common module (classes like: user, role, permission), so I have to configure it that way:

  lazy val shop = project.in(file("modules/shop"))
  .dependsOn(cirs)
  .dependsOn(common)
  .dependsOn(admin)  

  lazy val admin = project.in(file("modules/admin"))
  .dependsOn(cirs)
  .dependsOn(common)
  .dependsOn(shop)      

But in module common I have view where I wonna display links (a href...) to other submodules. To do this I have to use reverse routing classes, wich are controllers in submodules: shop and admin. So I have to use something like that:

<a href="@controllers.shop.routes.Index.index">shop</a>
<a href="@controllers.admin.routes.Index.index">admin</a>

Wich mean that I have to also add .dependsOn(shop).dependsOn(admin) for common module.

But it cause a Cyclic dependencies, wich is incorrect!

Please help me. How can I deal with it?

来源:https://stackoverflow.com/questions/25931754/build-sbt-defining-project-dependency-between-modules

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!