掲示板

How to put external jars in liferay 7

6年前 に vel murugan によって更新されました。

How to put external jars in liferay 7

Junior Member 投稿: 31 参加年月日: 17/05/19 最新の投稿
Is there any steps for adding external jars in liferay 7?
thumbnail
6年前 に Jorge Díaz によって更新されました。

RE: How to put external jars in liferay 7

Liferay Master 投稿: 753 参加年月日: 14/01/09 最新の投稿
thumbnail
6年前 に Santosh B Biradar によって更新されました。

RE: How to put external jars in liferay 7

Junior Member 投稿: 41 参加年月日: 15/08/04 最新の投稿
Hi,

You can add your external dependencies in build.gradle file. and then build and deploy your module.
Please go through DAVID H NEBINGER blog[https://web.liferay.com/es/web/user.26526/blog/-/blogs/osgi-module-dependencies].

Thanks
Santosh B B
6年前 に vel murugan によって更新されました。

RE: How to put external jars in liferay 7

Junior Member 投稿: 31 参加年月日: 17/05/19 最新の投稿
Thanks For your Reply . I Followed your mentioned Link"https://web.liferay.com/es/web/user.26526/blog/-/blogs/osgi-module-dependencies" . I added my external jar . when I deploy I got the "org.osgi.framework.BundleException: could not resolve module: searchformportlet [588]_ Unresolved requirements:Import-Package: antlr)[Sanitized]" .(3.png). and Also I attached the build.gradle (1.png) and bnd.bnd (2.png) . Please help me out from this issue.
thumbnail
6年前 に Jorge Díaz によって更新されました。

RE: How to put external jars in liferay 7

Liferay Master 投稿: 753 参加年月日: 14/01/09 最新の投稿
You have an unresolved dependency with antlr library (http://www.antlr.org/)

One important note: you have to include the dependencies of your code, but also include the dependencies of the added libraries.
6年前 に vel murugan によって更新されました。

RE: How to put external jars in liferay 7

Junior Member 投稿: 31 参加年月日: 17/05/19 最新の投稿
Thanks for your Reply. when I am adding the latest version of jasper report compileOnly group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.2.0'. it showing following error : Could not resolve all dependencies for configuration ':modules:SearchFormPortlet:compileClasspath'.
> Could not find org.olap4j:olap4j:0.9.7.309-JS-3.
Searched in the following locations:
https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public/org/olap4j/olap4j/0.9.7.309-JS-3/olap4j-0.9.7.309-JS-3.pom
https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public/org/olap4j/olap4j/0.9.7.309-JS-3/olap4j-0.9.7.309-JS-3.jar
Required by:
bsebWorkspace.modules:SearchFormPortlet:1.0.0 > net.sf.jasperreports:jasperreports:6.2.0
. Please help me .
thumbnail
6年前 に David H Nebinger によって更新されました。

RE: How to put external jars in liferay 7

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Your issue is the transitive dependencies.

You pull in jasper and, for the sake of the build, gradle includes all of the transitive dependencies on antlr, olap4j, etc to be available to complete a satisfactory build.

But this does not include jasper and all of the transitive dependencies into your module. It is up to you as the module developer to include all of the direct dependencies such as jasper as well as each and every one of the indirect, transitive dependencies.










Come meet me at Devcon 2017 or 2017 LSNA!
6年前 に vel murugan によって更新されました。

RE: How to put external jars in liferay 7

Junior Member 投稿: 31 参加年月日: 17/05/19 最新の投稿
Hi my build.gradle file below

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: "jstl", name: "jstl", version: "1.2"
compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"


compile project (":modules:customService:customService-api")
compile project (":modules:entityMaster:entityMaster-api")
compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '5.5.1',transitive: false
compile group: 'org.olap4j', name: 'olap4j', version: '1.2.0',transitive: false

}

My bnd.bnd file
Bundle-SymbolicName: searchformportlet
Bundle-Version: 1.0.1
-includeresource: \
@jasperreports-[0-9]*.jar,\
@olap4j-[0-9]*.jar;lib:=true
Import-Package: antlr;resolution:=optional



My Issue is :
I have added my external jar and it came properly when am deploying it showing started and after that it throws error .And in portlet display there is no form fields.

My exception image is below
6年前 に pleo84 84 によって更新されました。

RE: How to put external jars in liferay 7

New Member 投稿: 18 参加年月日: 17/03/26 最新の投稿
Up!
have you solved?

I've got same kind of problem trying to use JasperReport in LR7.

My gradle (project compile well):


repositories {
	maven {
		url "https://cdn.lfrs.sl/repository.liferay.com/nexus/content/groups/public"
		url "http://jaspersoft.artifactoryonline.com/jaspersoft/third-party-ce-artifacts"
	}
}	


dependencies {
	compileOnly group: "biz.aQute.bnd", name: "biz.aQute.bndlib", version: "3.1.0"
	compileOnly group: "com.liferay", name: "com.liferay.osgi.util", version: "3.0.0"
	compileOnly group: "com.liferay", name: "com.liferay.portal.spring.extender", version: "2.0.0"
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.6.0"
	
	compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
	compileOnly group: "javax.servlet", name: "javax.servlet-api", version: "3.0.1"
	compileOnly group: "com.liferay", name: "com.liferay.registry.api", version: "1.0.0"
	
	compileOnly project(":modules:MyServiceBuilder:MyServiceBuilder-api")
	
	compile group: 'net.sf.jasperreports', name: 'jasperreports', version: '6.4.1'	
}

buildService {
	apiDir = "../MyServiceBuilder-api/src/main/java"
	osgiModule = true
	propsUtil = "com.mine.portlet.servicebuilder.service.util.PropsUtil"
}


and my .bnd

Bundle-SymbolicName: myservicebuilder-service
Bundle-Version: 1.1.2.2
Liferay-Require-SchemaVersion: 1.0.0
Liferay-Service: true

-includeresource: \
@jasperreports-[0-9]*.jar

Import-Package: antlr;resolution:=optional


Compile ok, when i deploy to LR GoGoShell says ok (active) but when i use the portlet i receive error (generic nullpointer). I don't understand:
1) which dependecies i need in includeresource in .bnd
2) more in general, how to import jasperreport in lr7 emoticonemoticon


Thank you!
6年前 に vel murugan によって更新されました。

RE: How to put external jars in liferay 7

Junior Member 投稿: 31 参加年月日: 17/05/19 最新の投稿
I could not able to solve this issue still.
thumbnail
6年前 に Joye Luo によって更新されました。

RE: How to put external jars in liferay 7

Regular Member 投稿: 144 参加年月日: 16/05/03 最新の投稿
Hey David,

Is there a better way to resolve transitive dependencies problem?
I just use one third party class and add one third part dependencies in build.gradle file.
But it has numerous dependencies. It seems endless.