Jar tasks not executing

Hi, I’m migrating from maven to gradle and I can’t build my project
I have a dependency api(project(":myLibrary")) but only compileJava executed
Compilation fails because cannot find a jar file (jar task not executed)

If I use a implementation instead of api all works fine

(P.S my english very bad sorry)