osgi bundle jar cannot work in liferayosgi bundle jar cannot work in liferayhttps://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=1215115242024-03-29T13:05:57Z2024-03-29T13:05:57ZRE: osgi bundle jar cannot work in liferayRussell Bohlhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1215137442022-09-14T13:57:34Z2022-09-12T14:28:25Z<p>I think if you use <code>compileInclude files ...</code> you don't
want to put your JAR under the src folder. Just put it in a lib folder
in the root and do</p>
<p> </p>
<pre>
<code class="language-java">compileInclude files("lib/oracle-agile_1.0.0.jar")</code></pre>
<p>Or listen to whatever Olaf comes up with, that might be your best bet.</p>Russell Bohl2022-09-12T14:28:25ZRE: RE: osgi bundle jar cannot work in liferayScarletake Bwihttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1215116282022-09-12T09:11:49Z2022-09-12T09:11:49Z<p>hi Olaf</p>
<p>thank you for reply.</p>
<p>how i try using it: just like i said.</p>
<p>step 1. i put the osgi bundle jar in folder <My Project>/src/main/resources/META-INF/lib.</p>
<p>step 2. i modified my build.gradle, add </p>
<pre>
<code class="language-java">compileInclude files('META-INF/lib/oracle-agile_1.0.0.jar')</code></pre>
<p> </p>
<p>what's generated? E.g. how does the generated jar's MANIFEST look
like, and does it contain the classes you expect?</p>
<p>you can see my first image, and i am also export the jar via WinRar,
both jars in the jar.</p>
<p> </p>
<p> Does "using" the code fail at compile- or at runtime?</p>
<p>compile, i use gradle tasks's build, and it failed. the api cannot be
resolved from my program.</p>
<p>
<img alt="" height="351"
src="/documents/d/guest/image-29-png?imagePreview=1" width="632" /></p>Scarletake Bwi2022-09-12T09:11:49ZRE: osgi bundle jar cannot work in liferayOlaf Kockhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1215113972022-09-12T07:54:16Z2022-09-12T07:54:14Z<p>Can you expand on "cannot work": Please let us know</p>
<p>* how you try using it<br /> * what's generated? E.g. how does
the generated jar's MANIFEST look like, and does it contain the
classes you expect?<br /> * Does "using" the code
fail at compile- or at runtime?</p>Olaf Kock2022-09-12T07:54:14Zosgi bundle jar cannot work in liferayScarletake Bwihttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1215115232022-09-12T06:28:32Z2022-09-12T06:28:31Z<p>hi </p>
<p>i am using liferay 7.4, now i want use external jars for oracle agile
plm. AgileAPI.jar and pxapi.jar</p>
<p>for that perpose, i create a osgi bundle project and generate osgi
bundle jar by myself.</p>
<p>
<img alt="" height="322"
src="/documents/d/guest/image-26-png?imagePreview=1" width="589" /></p>
<p>and copied it to <My Project>/src/main/resources/META-INF/lib</p>
<p>
<img alt="" height="194"
src="/documents/d/guest/image-27-png?imagePreview=1" width="236" />
<br /> than modify my build.gradle</p>
<pre>
<code class="language-java">compileInclude files('META-INF/lib/oracle-agile_1.0.0.jar')</code></pre>
<p>but it still cannot work, my code still cannot use it.</p>
<p>i struggle