集成Eclipse RAP和OSGI/Spring-DM插件,使用Maven进行构建

发布于 2024-08-23 11:29:55 字数 1737 浏览 7 评论 0原文

背景 我有一个包含域模型和持久性代码的项目(使用 Spring-ROO 创建)。我已将其更改为 OSGi 包,并构建和构建使用 Maven 部署它(通过 PAX Construct 脚本)。该捆绑包可以很好地部署到 Equinox,我可以访问各种服务等。

我还有一个 Eclipse RAP 插件/捆绑包,我想从其中调用域捆绑包实现的服务/spring bean。这就是事情变得有趣的地方。

问题:

1) 如何设置由 Maven 构建的 Eclipse RAP 项目?我使用 mvn eclipse:to-maven 目标将 Eclipse RAP 目标平台的插件放入我的本地存储库,但是当我使用:

`pax-import-bundle -g org.eclipse.rap -a ui -v 1.3.0 -- -DimportTransitive -DwidenScope  `

我收到此错误:

[信息] [pax:import-bundle {执行:default-cli}]
[信息] 将 Eclipse UI 导入到 com.propertyselldirect.propsell.build:provision:pom:1.0.0-SNAPSHOT
[信息] 将 Eclipse UI 添加为 com.propertyselldirect:rap:bundle:1.0.0-SNAPSHOT
[信息] ---------------------------------------------------------- --------------------------
[错误] 致命错误
[信息] ---------------------------------------------------------- --------------------------
[INFO] org.eclipse.core 版本为 null:runtime
[信息] ---------------------------------------------------------- --------------------------
[信息] 跟踪
java.lang.NullPointerException:org.eclipse.core 的版本为 null:运行时
在 org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:390)

我还尝试添加每个 Eclipse 运行时 &手动 rap 依赖项,然后构建项目,但是当我部署到 OSGi(使用 pax-provision)时,大多数 Eclipse RAP(和 org.eclipse.core.runtime)插件都未激活。它们大多被列为INSTALLED

2) 或者,我应该使用 Eclipse PDE 来构建,然后包含我的域插件(可能还有所有 Spring-DM 包)作为依赖项。在这种情况下,我如何(自动)让 Eclipse PDE 访问那些将部署到我的 Maven 存储库的插件/包?我是否手动将它们安装到某个目标平台目录,并将其设为我的 RAP 目标平台? (即,因此具有添加了所有 Spring-DM 包的 RAP 目标平台)。

我还有很多问题,但现在这些就足够了。

任何指向网络上有用文档/文章的指示都将非常受欢迎。我用谷歌搜索过,但没有发现任何特别有用的东西。

The background
I have a project containing my domain model and persistence code (created using Spring-ROO). I've changed this into an OSGi bundle, and build & deploy it using Maven (via PAX Construct scripts). This bundle deploys nicely to Equinox, and I can access the various services,etc.

I also have a Eclipse RAP plugin/bundle from where I want to call the services/spring beans implemented by the domain bundle. And this is where things get interesting.

The question(s):

1) How do I setup the Eclipse RAP project to be build by Maven? I used the mvn eclipse:to-maven goal to get my Eclipse RAP target platform's plugins into my local repository, but when I use:

`pax-import-bundle -g org.eclipse.rap -a ui -v 1.3.0 -- -DimportTransitive -DwidenScope  `

I get this error:

[INFO] [pax:import-bundle {execution: default-cli}]
[INFO] Importing Eclipse UI to com.propertyselldirect.propsell.build:provision:pom:1.0.0-SNAPSHOT
[INFO] Adding Eclipse UI as dependency to com.propertyselldirect:rap:bundle:1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] version was null for org.eclipse.core:runtime
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.NullPointerException: version was null for org.eclipse.core:runtime
at org.apache.maven.artifact.DefaultArtifact.getBaseVersion(DefaultArtifact.java:390)

I have also tried adding every eclipse runtime & rap dependency by hand, and then the project builds, but when I deploy to OSGi (using pax-provision) then most of the Eclipse RAP (and org.eclipse.core.runtime) plugins are not active. They are mostly listed as INSTALLED.

2) Alternatively, should I rather use the Eclipse PDE to build, and then include my domain plugin (and probably all the Spring-DM bundles) as dependencies. In this case, how would I (automatically) get Eclipse PDE to get access to those plugins/bundles, which would be deployed to my Maven repository? Do I install them manually to some target platform directoty, and make that my RAP target platform? (i.e. thus having the RAP target platform with all the Spring-DM bundles added).

I have many more questions, but will suffice with these for now.

Any pointers to useful documentation/articles on the web will be very welcome. I have googled, but not found anything specifically helpful.

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

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

发布评论

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

评论(2

落在眉间の轻吻 2024-08-30 11:29:55

与我的一些朋友一起创建了 dynaresume 项目 (http://code.google.com/p/动态恢复/)。我们的主要目标是利用以下最佳实践:
- Eclipse RCP
- 弹簧DM
- JPA

目前它可以工作,但它没有做很多事情它主要是一个概念证明

我们还尝试提供一个 Web 客户端,例如 Eclipse RAP。

我使用 Maven 3/Tycho 来 mavenize 所有这些东西,恕我直言,这是 mavenize OSGi 包的最简单方法。

我想我们应该保持联系,因为我们的目标相同。

with some of my friends we create the dynaresume project (http://code.google.com/p/dynaresume/). Our main goal is to leverage best practices araund :
- Eclipse RCP
- Spring DM
- JPA

For the time being It works but It does not many things It's mainly a proof of concept

We try also to provide a Web Client such as Eclipse RAP.

I mavenized all this stuff using Maven 3/Tycho which is IMHO the easiest way to mavenize OSGi bundles.

I suppose we should keep in touch since we aiming the same goal.

终止放荡 2024-08-30 11:29:55

我不是 OSGi 专家,但也许可以看看 OSGi 与 Pax、Maven 和 Nexus Professional 简介。看起来 Sonatype 写了一些关于这个主题的东西。

I'm not an OSGi expert but maybe have a look at Introduction to OSGi with Pax, Maven, and Nexus Professional. It looks like Sonatype wrote some stuff on this subject.

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