如何在Eclipse PDE中表达项目间依赖关系 [英] How to express inter project dependencies in Eclipse PDE

查看:108
本文介绍了如何在Eclipse PDE中表达项目间依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找在混合项目类型之间处理项目间依赖关系的最佳实践,其中一些项目是eclipse插件/ OSGI捆绑项目(RCP应用程序),而其他项目只是简单的旧Java项目(Web服务模块)。几乎没有eclipse插件依赖于Java项目。



我的问题是,至少在我看来,没有办法干练地表达在Eclipse PDE环境中的依赖。我可以让插件项目依赖于其他插件项目(通过 Import-Package Require-Bundle manifest标题),但不是普通的java项目。



我似乎可以让项目声明对工作空间中另一个项目的jar的依赖,但是这些jar文件不能被导出或启动配置(尽管java代码编辑看起来很好)。



Java项目用于构建服务部署在J2EE容器上(目前为JBoss 4.2.2),并在某些情况下生成多个jar,一个用于部署到JBoss耳,另一个用于客户端代码(RCP应用程序)使用。



我们现在解决这个问题的方法是,我们还有两个外部工具启动器配置 - 一个用于构建所有的jar,另一个用于将这些jar复制到插件项目。这个工作(一种),但是整体构建和复制jar目标引起了相当大的构建步骤,绕过了整个eclipse增量构建功能,并且通过复制jar而不是仅引用我将依赖关系信息去耦的项目并且请求相当大的工作空间刷新,这样可以让开发时间像糖果一样。



我想要的是一个更自然的工作区设置,管理项目之间的依赖关系,仅在需要时请求增量重建,能够在RCP应用程序插件中使用服务库中的客户端代码,并能够启动具有所需必需类的RCP应用程序。



注意



要清楚的是,这不是关于依赖管理和模块管理,就像Eclipse PDE配置一样。



我很了解[Maven],[Ivy]和[Buckminster]等产品,解决了一个完全不同的问题(一旦解决了工作区配置问题,这些产品实际上可以用于实现工作空间和构建产品)

解决方案

我从来没有这样做,所以这是一个理论方法。但是我会尝试一个依赖管理系统,如ivy或maven2。



由于maven2做得更多,只是依赖关系管理,我建议在这种情况下使用常春藤。 / p>

I am looking for the best practice of handling inter project dependencies between mixed project types where some of the projects are eclipse plug-in/OSGI bundle projects (an RCP application) and others are just plain old java projects (web services modules). Few of the eclipse plug-ins have dependencies on Java projects.

My problem is that at least as far as I've looked, there is no way of cleanly expressing such a dependency in Eclipse PDE environment. I can have plug-in projects depend on other plug-in projects (via Import-Package or Require-Bundle manifest headers), but not of the plain java projects.

I seem to be able to have project declare a dependency on a jar from another project in a workspace, but these jar files do not get picked up by neither export nor launch configuration (although, java code editing sees the libraries just fine).

The "Java projects" are used for building services to be deployed on an J2EE container (JBoss 4.2.2 for the moment) and produce in some cases multiple jar's - one for deploying to the JBoss ear and another for use by client code (an RCP application).

The way we've "solved" this problem for now is that we have 2 more external tools launcher configurations - one for building all the jar's and another for copying these jar's to the plug-in projects. This works (sort of), but the "whole build" and "copy jars" targets incur quite a large build step, bypassing the whole eclipse incremental build feature and by copying the jars instead of just referencing the projects I am decoupling the dependency information and requesting quite a massive workspace refresh that eats up the development time like it was candy.

What I would like to have is a much more "natural" workspace setup that would manage dependencies between projects and request incremental rebuilds only as they are needed, be able to use client code from service libraries in an RCP application plug-ins and be able to launch the RCP application with all the necessary classes where they are needed.

So can I have my cake and eat it too ;)

NOTE

To be clear, this is not so much about dependency management and module management at the moment as it is about Eclipse PDE configuration.

I am well aware of products like [Maven], [Ivy] and [Buckminster] and they solve a quite different problem (once I've solved the workspace configuration issue, these products can actually come in handy for materializing the workspace and building the product)

解决方案

I never did it so this is a theoretical approach. But I'd try a dependency management system like ivy or maven2.

Since maven2 does much more, then just dependency management, I'd recommend ivy in this case.

这篇关于如何在Eclipse PDE中表达项目间依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆