依赖其他3个Play应用的Play应用 [英] Play app with dependencies on 3 other play apps

查看:79
本文介绍了依赖其他3个Play应用的Play应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个Play应用,该应用还依赖于其他3个Play应用,即第一个Play应用在build.sbt中具有3个依赖.

I am running a play app, this app has dependencies on 3 other play apps, i.e. the first play app has 3 dependencies in build.sbt.

现在,所有这四个应用程序都有自己的route.conf文件.

Now of course all these 4 apps have their own route.conf file.

问题是,当我启动第一个应用程序时,其中一个jar的API开始工作,而不是我启动的应用程序.我的意思是,当我作为依赖项添加的一个jar的API开始起作用时,第一个应用程序的所有API URL均无效且无法打开.

The thing is when I start the first app, APIs for one of the jars start working instead of the app that i started. What I mean is that all the API urls for the first app is invalid and doesn't open while APIs of one of the jars that I added as a dependency starts working.

有没有一种方法可以阻止这种情况的发生,最重要的是为什么会发生这种情况?

Is there a way to stop this from happening and most importantly why is this happening?

对不起,但是该信息在文档或其他地方不可用.

Sorry, but the info is not available in the docs or someplace else.

谢谢!

推荐答案

您必须确保routes是唯一的.

我所做的就是命名routes文件.只有一个名称为routes的人.

What I did was to name routes files. To have only one with the name routes.

在这一部中,我敬重其他部:

In this one I revered the other ones:

# Page.
GET        /wizard/:wizard/:user        server.WizardController.wizardPage(wizard: String, user: String)

# Reuse the routes from the ADAPTERS project
->         /                            adapters.Routes

这是我的示例: https://github.com/pme123/scala-adapters-向导

在您的情况下,这是另一回事(一条路径转发到另一条路径以使用不同的子路径)

In your case it is the other way around (one routes forwards to the other routes for different sub-paths)

# Page.
->        /app2   app2.Routes   
->        /app3   app3.Routes   
->        /app4   app4.Routes   

# Routes from app1
GET         /doIt                            controller.doIt()
...

然后运行所需的应用程序.类似于sbt app1/run.如果app1不是默认项目,则有必要-请参见

And that you run the app you want. Like sbt app1/run. This is necessary if app1 is not the default project - see the documentation.

这篇关于依赖其他3个Play应用的Play应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆