I use Liferay with tomcat and the specific jar can be found in TOMCAT_ROOT/webapps/ROOT/WEB-INF/lib.
So you need to take this jar to compile your portlet. But you are not allowed to add this to your war, because it is not allowed that the same jar - in this case portal-impl.jar - is in your war and in TOMCAT_ROOT/webapps/ROOT/WEB-INF/lib.
But how can your application access these jars?
You have to add to your WEB-INF folder the file
liferay-plugin-package.properties.
There you specify the jars that your application should use out of the TOMCAT_ROOT/webapps/ROOT/WEB-INF/lib folder.
In the key portal-dependency-jars you define the jars should be used.
Example:
name=NeededJarsTest
module-group-id=liferay
module-incremental-version=1
tags=sample
short-description=Demonstration how to access jars
change-log=
page-url=http://g-itblog.blogspot.com
author=Gastons-IT-Blog
licenses=LGPL
portal-dependency-jars=\
commons-beanutils.jar,\
commons-collections.jar,\
commons-digester.jar,\
commons-fileupload.jar,\
commons-lang.jar,\
commons-validator.jar,\
oro.jar,\
portal-impl.jar
speed-filters-enabled=false
Keine Kommentare:
Kommentar veröffentlichen