Search code examples
javagradledependenciesliferay-7

Service Builder not adding some dependencies?


I am following this tutorial to create a service builder in my project. When I execute the "buildService" from Gradle all the classes are created like it should. My problem is that some classes have wrong imports.

Some of the imports I managed to solve, but one in particular I can't solve. The import in question is:

com.liferay.portal.aop.AopService;

It cannot resolve this import. My build.gradle has the following dependencies:

dependencies {
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
    compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning"
    compileOnly group: "org.osgi", name: "org.osgi.core"
    compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
    compileOnly group: "com.liferay", name: "com.liferay.petra.string"
    compileOnly group: "com.liferay", name: "com.liferay.petra.lang"
    compileOnly project(":modules:user-activities-service:user-activities-service-api")
}

I assume that it is needed one more dependency to find this import. But I cant find anywhere what dependecy is this. Has anyone had the same problem? How should I solve this?


Solution

  • I managed to find what dependency I needed:

    compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api"