ERROR: java.lang.NoClassDefFoundError: co/elastic/apm/api/ElasticApm

Hi, the problem is the scope you use for the dependency:

You should remove the <scope>compile</scope> from the declaration, because the dependency needs to be on your runtime classpath. That should solve the issue.