使用gradle编译liferay工作空间时出错

Ery*_*ryo 5 workspace liferay gradle gradle-plugin

我在使用 liferay 和工作区插件时遇到问题。我不得不删除我计算机上的所有 gradle 缓存,突然之间,liferay 项目将无法再次编译......我执行命令:

./gradlew build
Run Code Online (Sandbox Code Playgroud)

我收到的错误是:

* Where:
Settings file 'src/liferay/settings.gradle' line: 20

* What went wrong:
A problem occurred evaluating settings 'liferay'.
> 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
Run Code Online (Sandbox Code Playgroud)

settings.gradle 文件中的这些行:

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: "3.4.48") {
            exclude group: "biz.aQute.bnd", module: "biz.aQute.bnd"
        }
        classpath group: "net.saliman", name: "gradle-properties-plugin", version: "1.4.6"
    }

}

apply plugin: "net.saliman.properties"

apply plugin: "com.liferay.workspace"
Run Code Online (Sandbox Code Playgroud)

该命令的输出./gradlew -v是:

------------------------------------------------------------
Gradle 6.6.1
------------------------------------------------------------

 

Build time:   2020-08-25 16:29:12 UTC
Revision:     f2d1fb54a951d8b11d25748e4711bec8d128d7e3

 

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.20 (Azul Systems, Inc. 11.0.20+8-LTS)
OS:           Linux 6.4.7-200.fc38.x86_64 amd64
Run Code Online (Sandbox Code Playgroud)

我尝试过使用 Java 11(我一直用于该项目的 java 版本)和 Java 17

我在互联网上寻找过这个错误,但没有看到解决方案。当我清理gradle缓存时问题就开始了,在此之前,项目编译完美

有人可以帮助我吗?

由于 liferay 工作区插件,我在编译 liferay 工作区时遇到问题。我想解决我的编译问题

Ola*_*ock 0

由于JDK 11.0.20 中默认设置的更改,已经报告了一些问题(在运行时系统中很容易修复,但在开发环境中显然不太容易修复)。我目前的建议(从 2023 年 8 月开始)是使用 11.0.19 max 进行构建。请注意,包含更多背景信息的链接博客文章自最初发布以来已经更新了几次。TL;DR:暂时降级至 11.0.19 。

如果单独这样做没有帮助,我的 settings.gradle 还声明 Liferay 存储库,例如在buildscript块中, after dependencies,添加

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

    maven {
        url "https://repository.liferay.com/nexus/content/groups/public"
    }
}
Run Code Online (Sandbox Code Playgroud)

不幸的是 Liferay尚不兼容 Java 17。


归档时间:

查看次数:

2758 次

最近记录:

2 年,5 月 前