Tuesday, August 7, 2012

Including External jars in your Liferay Extension

This is one that I've seen asked about a lot online, and the solution is so painfully simple that I can only conclude that the people who know the answer aren't bothering to help out those who are asking.

That's what this blog is for.

The environment:

Liferay 6.0
Apache Ant

You're trying to use the ant deploy command either from within Eclipse or on the command line but you have a dependency on another .jar file you need to include in the compilation.  If you do this in Eclipse, and include the .jar file in your project build path in Eclipse, the IDE will add a line to your any .classpath file pointing to this dependency.

The problem is that doesn't help your ant find the file.

If you need to include external .jar resources in your Ext, just drop a copy of the .jar you need in your Project/docroot/ext-lib/global folder.  Your ant deploy target should now be able to use it fine.


  1. Please do more because I really enjoyed reading your article on this.

  2. You can create your Ext plugin in Liferay Developer Studio, Liferay IDE. Within that directory, we have both jars and war files that encapsulates all of our core source.

  3. This post isn't about including Liferay .jars :) It's about what to do when you need external .jars from other sources.

  4. Thanks ! for sharing this wonderful news with us.I really like your post as it is informative as well as interesting.I am also quite interested to see your upcoming post for Web Development
    so please keep writing.

  5. Thanks for sharing this quality information with us. I really enjoyed reading.
    Website designer Birmingham Al