嗨,我在部署service-api和service-service时使用liferay 7.3.0此错误

问题描述

2020-09-02 19:15:51.972 ERROR [fileinstall-C:/Users/h.mohammadi/IdeaProjects/first-Liferay/bundles/osgi/modules][DirectoryWatcher:1112] Unable to start bundle: file:/C:/Users/h.mohammadi/IdeaProjects/first-Liferay/bundles/osgi/modules/slider.api.jar
org.osgi.framework.BundleException: Could not resolve module: slider.api [2409]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[4.1.0,5.0.0)"_ [Sanitized]
    at org.eclipse.osgi.container.Module.start(Module.java:444)
    at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
    at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundle(DirectoryWatcher.java:1095)
    at com.liferay.portal.file.install.internal.DirectoryWatcher._startBundles(DirectoryWatcher.java:1128)
    at com.liferay.portal.file.install.internal.DirectoryWatcher._process(DirectoryWatcher.java:990)
    at com.liferay.portal.file.install.internal.DirectoryWatcher.run(DirectoryWatcher.java:302)

解决方法

尝试将此行添加到bnd.bnd文件

Import-Package: *; version="0";resolution:=optional