I'm trying to use playwright to generate pdfs in my java application. This is working fine locale but when deploying it on an ec2 using Beanstalk I get the following error:
Nov 11 09:17:32 ip-172-xx-xx-2 web: 2021-11-11 09:17:32.927 ERROR 17681 --- [io-5000-exec-10] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.microsoft.playwright.PlaywrightException: Error {
Nov 11 09:17:32 ip-172-xx-xx-2 web: message='Host system is missing dependencies!
Nov 11 09:17:32 ip-172-xx-xx-2 web: Missing libraries are:
Nov 11 09:17:32 ip-172-xx-xx-2 web: libatk-1.0.so.0
Nov 11 09:17:32 ip-172-xx-xx-2 web: libatk-bridge-2.0.so.0
Nov 11 09:17:32 ip-172-xx-xx-2 web: libcups.so.2
Nov 11 09:17:32 ip-172-xx-xx-2 web: libxkbcommon.so.0
Nov 11 09:17:32 ip-172-xx-xx-2 web: libXcomposite.so.1
...
And of course, the error message is pretty straightforward. Dependencies are missing! I already got to know that I can install these dependencies via the CLI tools, but I have no idea where to install it and how in my build process via CodePipeline with CodeBuild and CodeDeploy. This is the command which you can find here: https://playwright.dev/java/docs/cli/#install-system-dependencies
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install-deps"
So the question is: Where and how do I install the Playwright dependency in my CodePipeline to run it on ec2 using beanstalk?
Thanks in advance!