Message Boards

web module gradle build failed

Hao Yong, modified 4 Years ago.

web module gradle build failed

New Member Posts: 2 Join Date: 9/21/19 Recent Posts
Hi.I'm following the portal develop tutorials( https://portal.liferay.dev/docs/7-2/tutorials ) to implement my first demo.There are 3 modules: api & service & web. It's something wrong with gradle building of web module, stacktrace shows the error below:Caused by: java.lang.NoSuchMethodError: com.liferay.gradle.plugins.tasks.DirectDeployTask.execute()V
        at com.liferay.gradle.plugins.LiferayOSGiPlugin$12.execute(LiferayOSGiPlugin.java:508)
        at com.liferay.gradle.plugins.LiferayOSGiPlugin$12.execute(LiferayOSGiPlugin.java:504)......
you can find the error detail at: https://scans.gradle.com/s/axb4cmebwm26c/my workspace settings.gradle:
buildscript {
    dependencies {
        classpath group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "2.1.5"
        classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
    }
    repositories {
        maven { url "https://mirrors.huaweicloud.com/repository/maven/" }
        maven {
            url "https://repository-cdn.liferay.com/nexus/content/groups/public"
        }
    }
}
apply plugin: "net.saliman.properties"
apply plugin: "com.liferay.workspace"
web module build.gradle:

dependencies {
    compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel"
    compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib"
    compileOnly group: "javax.portlet", name: "portlet-api"
    compileOnly group: "javax.servlet", name: "javax.servlet-api"
    compileOnly group: "jstl", name: "jstl"
    compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations"
}
jar.baseName = 'com.liferay.code.samples.portal.modules.applications.portlets.mvc-ds-jsp'
How to fix this ? Thanks very much!
Hao Yong, modified 4 Years ago.

RE: web module gradle build failed

New Member Posts: 2 Join Date: 9/21/19 Recent Posts
It seems like liferay gradle plugins not support gradle 5. when i downgrade gradle to 4.10, the problem is gone.In this case, DirectDeployTask is a subclass of org.gradle.api.tasks.JavaExec, and there is no method named "execute" within gradle 5.