首页 > 解决方案 > Liferay7中的编译问题

问题描述

我在 liferay 中创建了通过邮件附加的模块,并在 eclipse 中开发并执行了以下命令来编译它:

blade gw jar
o el comando 
gradlew distBundle

我有以下 build.gradle 文件:

dependencies {
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: '4.33.0'

compileOnly group: "javax.ws.rs", name: "javax.ws.rs-api", version: '2.1.1'
compileOnly group: "org.osgi", name: "org.osgi.core", version: "6.0.0"
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations",version: '1.3.0'
compileOnly group: "org.osgi", name: "org.osgi.service.jaxrs",version: '1.0.0'

compileOnly group: "com.liferay", name: "com.liferay.asset.category.property.api",version: '2.1.3'
compileOnly group: "com.liferay", name: "com.liferay.dynamic.data.mapping.api",version: '6.0.1'
compileOnly group: "com.liferay", name: "com.liferay.journal.api",version: '2.1.0'

compileOnly group: "javax.servlet", name: "javax.servlet-api",version: '4.0.1'

}

编译时出现以下错误:

C:\Users\usuario\Documents\LiferayA1CuatroOchenta\modules\modulo-rest-gestion-contenidos\cuatroochenta-rest\src\main\java\com\cuatro\ochenta\onesignal\listener\AvisoListener.java:55: error: cannot access CTModel
                if (Objects.equals(avisoStructureId, ddmStructure.getStructureId())) {
                                  ^
  class file for com.liferay.portal.kernel.model.change.tracking.CTModel not found
C:\Users\usuario\Documents\LiferayA1CuatroOchenta\modules\modulo-rest-gestion-contenidos\cuatroochenta-rest\src\main\java\com\cuatro\ochenta\rest\resource\AgendaTematicaResource.java:69: error: cannot access CTService
                DDMStructure ddmStructure = _ddmStructureLocalService.getDDMStructure(GetterUtil.getLong(PropsUtil.get("agenda.tematica.structure.id")));
                                                                     ^
  class file for com.liferay.portal.kernel.service.change.tracking.CTService not found
2 errors

当我执行以下命令时:

gradle gw jar

JournalArticle 类无法获取 CTmodel
我使用了以下 Liferay 版本:7.2.0-ga1

我在模块文件夹中附加了主要文件。

标签: liferayliferay-7.2

解决方案


推荐阅读