2

我已将包含上述文件的名为 util-java.jar 的 jar 添加到构建 .gradle 文件中。在编译时没有错误。但是在执行项目时,我得到了一个NoClassDefFoundError.

请告诉我如何消除这个问题。我的 build.gradle 如下:-

dependencies {
    compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
    compile group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
    compile group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
    compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.0"
    compile project(":modules:customuser:customuser-api")

    compile group: 'com.liferay.portal', name: 'portal-kernel', version: '5.2.3'
    runtime group: 'com.liferay.portal', name: 'portal-kernel', version: '5.2.3'



    compile group: 'com.liferay.portal', name: 'util-java', version: '6.2.4'
    runtime group: 'com.liferay.portal', name: 'util-java', version: '6.2.4'
}
4

2 回答 2

1

就像是 :

compileOnly 组:“com.liferay”,名称:“com.liferay.portal.dao.orm.custom.sql”,版本:“1.0.5”

应该能帮到你。

于 2017-02-07T08:13:56.103 回答
0

这是一个版本问题,更改

compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"

compile group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.5.0"
于 2021-03-09T09:21:34.973 回答