Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: osgi bundle jar cannot work in liferay
hi
i am using liferay 7.4, now i want use external jars for oracle agile plm. AgileAPI.jar and pxapi.jar
for that perpose, i create a osgi bundle project and generate osgi bundle jar by myself.
and copied it to <My Project>/src/main/resources/META-INF/lib
than modify my build.gradle
compileInclude files('META-INF/lib/oracle-agile_1.0.0.jar')
but it still cannot work, my code still cannot use it.
i struggle on it over 2 weeks, please help.
Can you expand on "cannot work": Please let us know
* how you try using it
* what's generated? E.g. how does
the generated jar's MANIFEST look like, and does it contain the
classes you expect?
* Does "using" the code
fail at compile- or at runtime?
hi Olaf
thank you for reply.
how i try using it: just like i said.
step 1. i put the osgi bundle jar in folder <My Project>/src/main/resources/META-INF/lib.
step 2. i modified my build.gradle, add
compileInclude files('META-INF/lib/oracle-agile_1.0.0.jar')
what's generated? E.g. how does the generated jar's MANIFEST look like, and does it contain the classes you expect?
you can see my first image, and i am also export the jar via WinRar, both jars in the jar.
Does "using" the code fail at compile- or at runtime?
compile, i use gradle tasks's build, and it failed. the api cannot be resolved from my program.
I think if you use compileInclude files ...
you don't
want to put your JAR under the src folder. Just put it in a lib folder
in the root and do
compileInclude files("lib/oracle-agile_1.0.0.jar")
Or listen to whatever Olaf comes up with, that might be your best bet.
Powered by Liferay™