RE: LF 7.4 GA 33 - issue with running any gradle command into workspace

Olaf Kock, modified 2 Years ago. New Member Posts: 5 Join Date: 8/1/23 Recent Posts

Hello,

I have a weird issue I cannot find out the cause. When running gradle into any of my projects I get the following error:

* What went wrong:
A problem occurred evaluating settings 'projectportal74'.
> Failed to apply plugin 'com.liferay.workspace'.
   > Could not create an instance of type com.liferay.gradle.plugins.workspace.WorkspaceExtension.
      > com/liferay/portal/tools/bundle/support/commands/DownloadCommand

And stackstrace shows class def. not found:

Caused by: java.lang.NoClassDefFoundError: com/liferay/portal/tools/bundle/support/commands/DownloadCommand
        at com.liferay.gradle.plugins.workspace.WorkspaceExtension.lambda$_getProductInfo$0(WorkspaceExtension.java:573)
        at com.liferay.gradle.plugins.workspace.WorkspaceExtension._getProductInfo(WorkspaceExtension.java:570)
        at com.liferay.gradle.plugins.workspace.WorkspaceExtension._getDefaultAppServerVersion(WorkspaceExtension.java:524)
        at com.liferay.gradle.plugins.workspace.WorkspaceExtension.<init>(WorkspaceExtension.java:86)
        at com.liferay.gradle.plugins.workspace.WorkspaceExtension_Decorated.<init>(Unknown Source)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at org.gradle.internal.instantiation.generator.AsmBackedClassGenerator$InvokeConstructorStrategy.newInstance(AsmBackedClassGenerator.java:1969)
        at org.gradle.internal.instantiation.generator.AbstractClassGenerator$GeneratedClassImpl$GeneratedConstructorImpl.newInstance(AbstractClassGenerator.java:468)
        at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.doCreate(DependencyInjectingInstantiator.java:64)

 

I used Liferay IDE latest stable version, with com.liferay.gradle.plugins.workspace version 4.0.10 and when looking into gradle cache there is the library containing DownloadCommand 3.7.3.

Gradle used 6.6.1.

JDK used is AWS Corretto 11.

Settings.gradle looks like this:

buildscript {

dependencies {

classpath group: "biz.aQute.bnd", name: "biz.aQute.bnd", version: "5.2.0"
classpath(group: "com.liferay", name: "com.liferay.gradle.plugins.workspace", version: "4.0.10") {
exclude group: "biz.aQute.bnd", module: "biz.aQute.bnd"
}

classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
}

repositories {
maven {
url "https://repository-cdn.liferay.com/nexus/content/groups/public"
}

 

maven {
url "https://repository.liferay.com/nexus/content/groups/public"
}
}
}

 

apply plugin: "net.saliman.properties"
apply plugin: "com.liferay.workspace"

 

Thanks,

Ova

 

7.4
thumbnail
Olaf Kock, modified 2 Years ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

Could it be possible that you're on JDK 11.0.20+?

If yes: At the moment it's best to compile with a JDK up to 11.0.19 until the changed JDK defaults have safely made it into the development scripts.

Jamie Sammons, modified 2 Years ago. New Member Posts: 5 Join Date: 8/1/23 Recent Posts

Yes. You are right. I fix it this morning by forcing back to 11.0.19 and now all works ok.