I'm building an portlet service for Liferay using intellij Idea, but I am strugling in importing a module made by gradle as dependency management
the exption is
Build file 'G:\Projets\[...]\build.gradle' line: 2
A problem occurred evaluating project ':xxx-service-api'.
> Could not find method compileOnly() for arguments [{group=com.liferay, name=com.liferay.petra.lang, version=5.2.1}] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
the build.gradle
dependencies {
compileOnly group: "com.liferay", name: "com.liferay.petra.lang", version: "5.2.1"
compileOnly group: "com.liferay", name: "com.liferay.petra.string", version: "5.3.4"
compileOnly group: "com.liferay", name: "com.liferay.portal.aop.api", version: "3.0.5"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "13.0.0"
compileOnly group: "org.osgi", name: "org.osgi.annotation.versioning", version: "1.1.2"
compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.5.1"
compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "8.1.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "3.0.1"
compileOnly group: "org.slf4j", name: "slf4j-api", version: "1.7.2"
}
Im using gradle 5.6.4 and liferay dxp-7.4
Make sure you apply the Java plugin if you want to use
compileOnly.