<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How to include jar under tomcat/webapp/ROOT/WEB-INF/lib to my own project?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=100102023" />
  <subtitle>How to include jar under tomcat/webapp/ROOT/WEB-INF/lib to my own project?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=100102023</id>
  <updated>2026-04-08T00:30:24Z</updated>
  <dc:date>2026-04-08T00:30:24Z</dc:date>
  <entry>
    <title>RE: How to include jar under tomcat/webapp/ROOT/WEB-INF/lib to my own proje</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=100105690" />
    <author>
      <name>旻 吴</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=100105690</id>
    <updated>2025-04-15T00:43:36Z</updated>
    <published>2017-12-05T06:42:52Z</published>
    <summary type="html">simple solution: use truezip-6.8.1 which does not include those classes in the default/unnamed &amp;#39;.&amp;#39; package</summary>
    <dc:creator>旻 吴</dc:creator>
    <dc:date>2017-12-05T06:42:52Z</dc:date>
  </entry>
  <entry>
    <title>How to include jar under tomcat/webapp/ROOT/WEB-INF/lib to my own project?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=100102022" />
    <author>
      <name>旻 吴</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=100102022</id>
    <updated>2025-04-15T00:43:36Z</updated>
    <published>2017-12-05T02:20:53Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hello everyone. I am trying to use Truezip under tomcat_root/webapp/ROOT/WEB-INF/lib/truezip.jar for my own project, a liferay service module to override ResourceMVCCommand of the OOB document library portlet. I am using tomcat-8.0.32 and liferay dxp. &lt;br&gt;&lt;br&gt;The build.gradle is:&lt;br&gt;&lt;pre&gt;&lt;code&gt;dependencies {
	compileOnly group: "com.liferay.portal", name: "com.liferay.portal.kernel", version: "2.0.0"

	compileOnly group: "com.liferay", name: "com.liferay.document.library.api", version: "3.2.1"
	compileOnly group: "com.liferay", name: "com.liferay.document.library.service", version: "1.1.21"
	compileOnly group: "com.liferay", name: "com.liferay.petra.memory", version: "1.0.0"
	
	compileOnly group: "org.osgi", name: "osgi.cmpn", version: "6.0.0"
	compileOnly group: "org.osgi", name: "org.osgi.service.component.annotations", version: "1.3.0"

	compileOnly group: "javax.portlet", name: "portlet-api", version: "2.0"
	compileOnly group: "javax.servlet", name: "servlet-api", version: "2.5"
	
	compileOnly group: 'truezip', name: 'truezip', version: '6.7' // the truezip.jar of liferay shows that its version is 6.7.
	runtime group: 'truezip', name: 'truezip', version: '6.7'
}&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I've included &lt;br&gt;&lt;pre&gt;&lt;code&gt;import de.schlichtherle.io.ArchiveDetector;
import de.schlichtherle.io.ArchiveException;
import de.schlichtherle.io.DefaultArchiveDetector;
import de.schlichtherle.io.File;
import de.schlichtherle.io.FileOutputStream;
import de.schlichtherle.io.archive.zip.ZipDriver;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;to rewrite the zip process of resource command. &lt;br&gt;&lt;br&gt;However, after deploying, osgi container says: &lt;br&gt;&lt;pre&gt;&lt;code&gt;org.osgi.framework.BundleException: Could not resolve module: test.document.resource.mvcaction.override [2481]
  Unresolved requirement: Import-Package: de.schlichtherle.io&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;&lt;br&gt;I've tried to copy truezip.jar to the tomcat's global jar path but neither tomcat/lib nor tomcat/lib/ext worked even after restarting the server.&lt;br&gt;&lt;br&gt;I also tried the methods described in the &lt;a href="https://web.liferay.com/zh/web/26526/blog/-/blogs/osgi-module-dependencies"&gt;blog: osgi module dependencies&lt;/a&gt; but all failed due to another reason: &lt;br&gt;&lt;blockquote&gt;&lt;br&gt;truezip.jar has classes defined in its root path:&lt;br&gt;decrypt.class&lt;br&gt;encrypt.class&lt;br&gt;nzip.class&lt;br&gt;therefore using Include-Resource / Bundle-Path syntax of bnd will result in :&lt;br&gt;`The default package '.' is not permitted by the Import-Package syntax. ` error.&lt;br&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;Before using the complex way of removing root path classes from jar file and trying Uber Module/Including Module approach, I wonder if there is any easier way to access the jar files under tomcat/webapp/ROOT/WEB-INF/lib or tomcat/lib. Thank you very much.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>旻 吴</dc:creator>
    <dc:date>2017-12-05T02:20:53Z</dc:date>
  </entry>
</feed>
