Liferay应用程序 - 模块集成问题 - 未创建JAR文件

问题描述 投票:0回答:1

我正在研究LifeRay应用程序。它正在构建但是jar文件没有被创建,并且AutoDeploy无法正常工作。我正在尝试将3个模块集成到现有项目中。

请注意 - 已启用AutoDeploy

IDE - Eclipse Photon Liferay版本 - 7

错误 -

2019-02-14 09:07:00.819 ERROR [fileinstall-C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules][org_apache_felix_fileinstall:97] Error while starting bundle: file:/C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules/jasper-report-api.jar 
org.osgi.framework.BundleException: Could not resolve module: jasper-report-api [978]_  Unresolved requirement: Import-Package: com.liferay.portal.reports.engine.console.model; version="[1.0.0,2.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 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1218)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:507)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)

第1单元 - Build.Gradle文件 -

dependencies {
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: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "3.0.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
compile name : 'com.liferay.portal.reports.engine.console.api-2.0.0'
//compile name : 'com.liferay.portal.reports.engine.console.api-1.0.0'
}
repositories {
   flatDir {
       dirs 'lib'
   }
}

第1单元 - bnd文件 -

Bundle-Name: Jasper-report-api
Bundle-SymbolicName: jasper-report-api
Bundle-Version: 1.0.0

Export-Package: \
com.knowarth.report.api,\
com.knowarth.report.api.bean,\
com.knowarth.report.api.contants

尝试部署模块1时显示错误 -

2019-02-14 09:30:01.772 ERROR [fileinstall-C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules][org_apache_felix_fileinstall:97] Error while starting bundle: file:/C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules/jasper-report-web.jar 
org.osgi.framework.BundleException: Could not resolve module: jasper-report-web [979]_  Unresolved requirement: Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,2.0.0)"_  Unresolved requirement: Import-Package: com.knowarth.report.api; version="[1.0.0,2.0.0)"_    -> Export-Package: com.knowarth.report.api; bundle-symbolic-name="jasper-report-api"; bundle-version="1.0.0"; version="1.0.0"; uses:="com.knowarth.report.api.bean,com.liferay.portal.reports.engine.console.model,javax.portlet"_       jasper-report-api [978]_         Unresolved requirement: Import-Package: com.liferay.portal.reports.engine.console.model; version="[1.0.0,2.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 org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)

第2单元 - Build.Gradle文件 -

dependencies {
compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
compileOnly group: "com.liferay.portal", name: "com.liferay.util.taglib", version: "2.0.0"
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
//compileOnly group: "javax.servlet", name: "servlet-api", version: "2.5"
compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly group: "jstl", name: "jstl", version: "1.2"
compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
compileOnly group: "com.liferay", name: "com.liferay.portal.reports.engine.api", version: "3.0.0"
compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"
compileOnly group: "com.liferay", name: "com.liferay.portal.configuration.metatype", version: "2.0.0"
compileOnly project(":modules:Jasper-report-api")
compile name : 'com.liferay.portal.reports.engine.console.api-2.0.0'
}
repositories {
   flatDir {
       dirs 'lib'
   }
}

第2单元 - Bnd文件 -

Bundle-SymbolicName: jasper-report-web
Bundle-Version: 1.0.0

第2单元 - 错误 -

2019-02-14 09:34:12.029 ERROR [fileinstall-C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules][org_apache_felix_fileinstall:97] Error while starting bundle: file:/C:/LR/liferay-ce-portal-7.1.1-ga2/osgi/modules/jasper-report-impl.jar 
org.osgi.framework.BundleException: Could not resolve module: jasper-report-impl [980]_  Unresolved requirement: Import-Package: com.knowarth.report.api.bean; version="[1.0.0,2.0.0)"_    -> Export-Package: com.knowarth.report.api.bean; bundle-symbolic-name="jasper-report-api"; bundle-version="1.0.0"; version="1.0.0"_       jasper-report-api [978]_         Unresolved requirement: Import-Package: com.liferay.portal.reports.engine.console.model; version="[1.0.0,2.0.0)"_  Unresolved requirement: Import-Package: com.knowarth.report.api; version="[1.0.0,2.0.0)"_    -> Export-Package: com.knowarth.report.api; bundle-symbolic-name="jasper-report-api"; bundle-version="1.0.0"; version="1.0.0"; uses:="com.knowarth.report.api.bean,com.liferay.portal.reports.engine.console.model,javax.portlet"_ [Sanitized]
at org.eclipse.osgi.container.Module.start(Module.java:444)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:428)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1258)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1230)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)
at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)

第3单元 - Build.Gradle文件 -

dependencies {
compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"
compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
//compileOnly group: "javax.servlet", name: "servlet-api", version: "2.5"
compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
compileOnly project(":modules:Jasper-report-api")
compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
compile name : 'com.liferay.portal.reports.engine.console.api-2.0.0'
}
repositories {
   flatDir {
       dirs 'lib'
   }
}

第3单元 - Bnd文件 -

Bundle-Name: jasper-report-service
Bundle-SymbolicName: jasper-report-impl
Bundle-Version: 1.0.0
eclipse-plugin liferay liferay-7 eclipse-photon
1个回答
1
投票

您正在使用旧内核作为依赖项:

证据:

Import-Package: com.liferay.portal.kernel.model; version="[1.0.0,2.0.0)"

问题:

compile group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"

替换内核为7.1.1-ga2 - > Bundle-Version:3.39.2或者你认为最好的任何范围,只要范围包括3.39.2,就像3.39。+

© www.soinside.com 2019 - 2024. All rights reserved.