Are you trying to use a custom Java API. If so - you need to wrap that
JAR that exposes the Java package into an OSSi bundle and deploy to AEM.
Remember that when building an OSGi bundle that contains a Java API -
you need to ensure 2 things:1 - you reference the API in the POM (which
you did)2 - you need to make sure there is a deployed OSGi bundle in the
AEM Service container that exposes the given Java package - sounds like
this is not the case).