Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: LF 7.4 GA 33 - issue with running any gradle command into workspace
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
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.
Yes. You are right. I fix it this morning by forcing back to 11.0.19 and now all works ok.
Powered by Liferay™