Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Kan Kon
Building Plugin with another project reference
October 30, 2012 10:19 AM
Answer

Kan Kon

Rank: New Member

Posts: 23

Join Date: September 12, 2011

Recent Posts

How do I include another project for building a project? For example, I have a portlet project available. When building a new plugin project, how can i include the other portlet project? From IDE, I could add the build path, but at the time of compilation it fails as though the referred classes are not available in the classpath. Any ideas? Thanks.
David H Nebinger
RE: Building Plugin with another project reference
October 30, 2012 10:45 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6274

Join Date: September 1, 2006

Recent Posts

You cannot do this.

As separate plugins they are deployed as separate artifacts (WAR files). The application container will not allow you to share classes between WAR files.

For shared code, you have a couple of options:

1. build separate jar and put into global lib (i.e. tomcat's lib/ext directory).
2. build separate jar and deploy as part of EXT plugin (other plugins can access the code by including the jar in liferay-plugin-package.properties file).
3. build separate EXT plugin and put code there (results in a separate jar file to include in liferay-plugin-package.properties file).
4. manually copy code between the plugins.
Roberto Díaz
RE: Building Plugin with another project reference
November 7, 2012 4:14 AM
Answer

Roberto Díaz

LIFERAY STAFF

Rank: New Member

Posts: 24

Join Date: October 30, 2012

Recent Posts

Paste the .jar from the first project available on the lib folder from the second one and add this jar to the build path.