从捆绑包中排除子目录; BND 文件中的包含资源

发布于 2024-09-26 23:23:16 字数 330 浏览 0 评论 0原文

我正在尝试将 GWT Eclipse 项目放入 Bundle-Jar 文件中。 为此,我必须将 war 文件夹添加到捆绑包中。问题是 GWT 编译器将所有 *.class 文件添加到文件夹 war/WEB-INF/classes 中。 BND 尝试将所有 *.class 文件添加到 jar 文件中,但它们位于项目中的错误路径上。这就是问题所在!因此,我在 BND 文件中寻找正确的 Include-Resource: 属性。

有人知道我可以从包含资源表达式中排除特殊文件吗?

如果我每次都删除类子文件夹,它就会起作用。但几秒钟后,GWT SDK 将生成此类。

非常感

谢塞巴斯蒂安

Im trying to put a GWT Eclipse project to a Bundle-Jar file.
For that I have to add the war folder to the bundle. The problem is that the GWT compiler add all *.class files in the folder war/WEB-INF/classes. BND try to add all *.class files in the jar file but they are on the wrong path in the project. Thats the problem! Thus I looking for the right Include-Resource: attribute in my BND file.

Is there someone who has an idea who i can exclude special files from a Include-Resource expression.

It works if I delete every time the classes sub folder. But after few second the GWT SDK will generate this classes.

Thanks a lot

Sebastian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

朮生 2024-10-03 23:23:16

请检查:http ://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#ApacheFelixMavenBundlePlugin%28BND%29-说明

<导出包> ...可以通过启动使用否定来排除包
带有“!”的封装模式。因此,
非否定模式表明哪一个
要包含的可用包
束,而否定模式
指出不应包含哪些内容
在捆绑包中。

您还可以查看此项目:“http://bitbucket.org/MikhailKotelnikov/projecttemplate”。它是简单 OSGi/GWT 应用程序的模板。
在这里,我像往常一样对所有 GWT 相关类进行编译/打包,但我为 BND 工具添加了以下说明:

DynamicImport-Package: *
Import-Package: *;resolution:=optional 

在这种情况下,BND 认为这些包将由 OSGi 环境在运行时提供,并且它可以正确完成工作。

Please check this: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html#ApacheFelixMavenBundlePlugin%28BND%29-Instructions:

<Export-Package> ... it is possible to exclude packages using negation by starting
the package pattern with '!'. Thus,
non-negated patterns indicate which of
the available packages to include in
the bundle, whereas negated patterns
indicate which should not be included
in the bundle.

You can also check this project: "http: //bitbucket.org/MikhailKotelnikov/projecttemplate". It is a template for a simple OSGi/GWT application.
Here I do the compilation/packaging of all GWT-dependent classes as usual but I added the following instructions for the BND tool:

DynamicImport-Package: *
Import-Package: *;resolution:=optional 

In this case BND considers that these packages will be provided by the OSGi environmet at the runtime and it does the job correctly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文