Lagom Kubernetes Recipe

Hi,

I have a simple working Lagom recipe with Cassandra. mvn lagom:runAll works fine.

But when I add the fabric8 or spotify Docker plugin I get a build error.

An example with the fabric8 plugin is here.https://github.com/lagom/lagom-recipes/blob/master/kubernetes-deployment/hello-kubernetes-java-mvn/pom.xml

[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ hello-api —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory D:\AWS\ReactiveMicroServices\Elasticity\hello-api\src\main\resources
[INFO]
[INFO] — maven-compiler-plugin:3.8.1:compile (default-compile) @ hello-api —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to D:\AWS\ReactiveMicroServices\Elasticity\hello-api\target\classes
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for Elasticity 1.0-SNAPSHOT:
[INFO]
[INFO] Elasticity … SUCCESS [ 39.315 s]
[INFO] hello-api … FAILURE [ 2.794 s]
[INFO] hello-impl … SKIPPED
[INFO] stream-api … SKIPPED
[INFO] stream-impl … SKIPPED
[INFO] integration-test … SKIPPED
[INFO] cassandra-config … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.764 s
[INFO] Finished at: 2019-06-10T16:16:53+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project hello-api: Compilation failure -> [Help 1]

The command I use is mvn package docker:build. Why does this fail only in this case ?

Thanks,
Mohan

So I use spotify’s Docker plugin and I build with mvn package dockerfile:build and a Dockerfile. It works.

But the error I posted earlier occurs for some reason with both plugin’s.

The examples in lagom-recipes are deprecated and no longer maintained.

Could you try this example?

The shopping-cart-java project contains both sbt and Maven build files, and you can choose either one. I just tested that mvn package docker:build completes successfully for me in this project. If you are still having problems, it could be helpful to post the full output (or paste it into gist.github.com and link to that here). One possibility is an incompatible version of Docker on your system (I’m running 18.09.2 on mine).

Ok. It worked for me if I use a DockerFile. But I didn’t come across any note about deprecation. And Many links from some of Lagom’s ebooks and website show me 404.

Could you raise a GitHub issue with the URLs that return 404 and the references linking to those? We try to fix these to redirect to updated locations. Thanks!