Exporting and Importing packages with bnd.bndExporting and Importing packages with bnd.bndhttps://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1216538642024-03-28T07:55:21Z2024-03-28T07:55:21ZRE: RE: Exporting and Importing packages with bnd.bndDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1216627042023-03-03T16:22:27Z2023-03-03T14:15:15Z<p>compileOnly only declares the dependency on a package, it will not
include it nor guarantee it's availability at deployment time.</p>
<p>
<a href="https://liferay.dev/blogs/-/blogs/gradle-compile-vs-compileonly-vs-compileinclude">https://liferay.dev/blogs/-/blogs/gradle-compile-vs-compileonly-vs-compileinclude</a></p>
<p>Also, compileOnly does not include the package in the Import-Package
directive in METAINF.inf, that's why you are forced to put it into the
bnd.bnd file.</p>
<p>I think it is just the case that you're using the wrong directive in
your build.gradle file.</p>David H Nebinger2023-03-03T14:15:15ZRE: RE: Exporting and Importing packages with bnd.bndSebastian Wikholmhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1216612822023-03-02T19:27:26Z2023-03-02T06:43:54Z<p>This would of course be fine and dany if it did work. I´ve tried to
declare a dependency in the build.gradle and a bunch of stuff, as i
always do before i ask questions here.</p>
<p>According to the official guides the package should be available to
declare a dependency like </p>
<blockquote>
<p>compileOnly group: "com.liferay", name: "com.liferay.item.selector.criteria.api"</p></blockquote>
<p>Allthough i do use export-package: i get</p>
<blockquote>
<p>Could not resolve all files for configuration</p></blockquote>Sebastian Wikholm2023-03-02T06:43:54ZRE: Exporting and Importing packages with bnd.bndDavid H Nebingerhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1216601182023-03-01T19:24:13Z2023-03-01T18:18:53Z<p>The Export-Package you do need to do, but you don't have to worry
about the Import-Package directive. That will be handled during the
build simply by declaring the dependency on the other module.</p>
<p>If <em>all</em> you are doing is modifying the bnd.bnd's
Import-Package directive but not using the build.gradle to declare the
dependency, then you're not understanding how the Import-Package
directive is being used. It will not affect gradle, it will not
afffect the build, it will only apply when the OSGi container is
trying to process your module and will fail with an <em>Unresolved
Requirement </em>exception if the module exporting the package is
not available.</p>David H Nebinger2023-03-01T18:18:53ZExporting and Importing packages with bnd.bndSebastian Wikholmhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1216538632023-02-21T19:58:16Z2023-02-20T06:05:54Z<p> Im trying to make an utility class with some methods and constants
for usage in other modules. I use "Export-Package:" in the
module where i want to export the package, and Import-Package in the
module where i want to import it. According to the tutorials this
should work automatically.</p>
<p>It does not. As there a