Lagom : Importing external Lagom service to another service by using lagomExternalScaladslProject method

I’m trying to split my project into multiple builds following the doc.

I published my external Lagom services on Jfrog Artifactory.

I import the services by using :

lazy val myservice = lagomExternalScaladslProject("myservice", "myserviceimpl" % "myserviceimpl_version" % "1.0").enablePlugins(LagomScala)

When i runAll in sbt shell, i get the fallowing error :

    java.lang.RuntimeException: No application loader is configured. Please configure an application loader either using the play.application.loader configuration property, or by depending on a module that configures one. You can add the Guice support module by adding "libraryDependencies += guice" to your build.sbt.
        at scala.sys.package$.error(package.scala:27)
        at play.api.ApplicationLoader$.play$api$ApplicationLoader$$loaderNotFound(ApplicationLoader.scala:52)
        at play.api.ApplicationLoader$.apply(ApplicationLoader.scala:161)
        at play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$4(LagomReloadableDevServerStart.scala:201)
        at play.utils.Threads$.withContextClassLoader(Threads.scala:22)
        at play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$2(LagomReloadableDevServerStart.scala:195)
        at scala.Option.map(Option.scala:242)
        at play.core.server.LagomReloadableDevServerStart$$anon$1.$anonfun$get$1(LagomReloadableDevServerStart.scala:171)
        at scala.util.Success.flatMap(Try.scala:258)
        at play.core.server.LagomReloadableDevServerStart$$anon$1.get(LagomReloadableDevServerStart.scala:170)
        at play.core.server.Server.reload(Server.scala:46)
        at play.core.server.Server.reload$(Server.scala:46)
        at play.core.server.AkkaHttpServer.reload(AkkaHttpServer.scala:65)
        at com.lightbend.lagom.dev.Reloader$$anon$2.reload(Reloader.scala:155)
        at com.lightbend.lagom.sbt.LagomReloadableService$.$anonfun$projectSettings$23(LagomPlugin.scala:240)
        at scala.Function1.$anonfun$compose$1(Function1.scala:49)
        at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
        at sbt.std.Transform$$anon$4.work(Transform.scala:68)
        at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
        at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
        at sbt.Execute.work(Execute.scala:291)
        at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
        at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
11:30:05.376 [info] play.core.server.AkkaHttpServer [] - Listening for HTTP on /127.0.0.1:58213
Stacktrace caused by project myserviceImpl(filesystem path to project is C:\Users\home\lagom\myproject\currentservice\target\lagom-external-projects\myserviceImpl).

When i add the “guice” dependency in the imported service like this :

lazy val myservice = lagomExternalScaladslProject("myservice", "myserviceimpl" % "myserviceimpl_version" % "1.0")
.enablePlugins(LagomScala)
.settings(
    publish / skip := true,
    libraryDependencies += guice,
  )

it run without run time exception but i try to request the service with Insomnia
i get this :

[info] Service myserviceImpl listening for HTTP on 127.0.0.1:58213
[info] Service otherserviceImpl listening for HTTP on 127.0.0.1:53048
[info] Service currentService listening for HTTP on 127.0.0.1:49213
[info] (Services started, press enter to stop and go back to the console...)

17:56:56.204 [GATEWAY] [warn] com.lightbend.lagom.internal.scaladsl.registry.ScalaServiceRegistryClient [] - serviceName=[myservice] was not found. Hint: Maybe it was not started?
17:56:56.213 [GATEWAY] [error] home.services.gateway.internal.controllers.Main [] - [Message] Service item was not found by service locator, [TRACE] java.lang.IllegalStateException: Service myservice was not found by service locator

I don’t know what i’ve missed.

I’m using lagom 1.6,
SBT 1.4.7,
IntelliJ Community 2020.2,
JDK 8