我应该使用Eclipse插件(或OSGi捆绑软件)作为普通的依赖项管理工具吗? [英] Should I use Eclipse plug-ins (or OSGi Bundles) as a plain dependency management tool?

查看:82
本文介绍了我应该使用Eclipse插件(或OSGi捆绑软件)作为普通的依赖项管理工具吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它再次发生了……我加入了一个新项目,该项目由几个相互依赖的简单Eclipse Java项目组成,所有项目都通过Project构建路径进行管理.我觉得这有点混乱.而当涉及到运行配置时,您只需输入地狱即可.

once again it has happened... I joined a new project, composed of several plain Eclipse Java Projects, with interdependencies, all managed through the Project build path. I find this all a bit of a chaos. And when it comes to run configurations - you just enter hell.

过去,即使我从未打算将这些项目作为osgi-bundles运行,我仍然坚持创建插件项目,而不是普通的Java项目.我只是发现依赖关系在插件项目中更易于管理.其他人也走同样的路吗?有什么反对这种方法的吗?

In the past I've sticked to create plug-in projects, instead of plain Java projects - even if I never intend to run these projects as osgi-bundles. I just find that dependencies are way easier to manage in plug-in projects. Are other people taking the same path? Anything against this approach?

推荐答案

如果您阅读

If you read the restructure of org.aspectj document, that project did precisely that:

  • 所有依赖项都将在OSGi捆绑包清单文件中表示,该文件指定一个类路径(用于库jar)和必需"捆绑包.
    出于构建和测试目的,必须包括部署环境中预期或希望的库(例如XMLJRocket),但不应包括在发货产品中.这些可能被指定为可选"必需包或必需包

  • All dependencies would be expressed in OSGi bundle manifest files, which specify a classpath (for library jars) and "required" bundles.
    Libraries expected or hoped for in the deployment environment (e.g., XML or JRocket) must be included for build and test purposes but excluded from the shipping product. These might be specified as "optional" required-bundles or as required-packages

初始二进制程序集将通过通常的bundle程序集工作,bundle输出包括所需的bundle片段中的二进制文件(但不是可选的bundles中的二进制文件)

Initial binary assembly would work through the usual bundle assembly, with the bundle output including binaries from bundle fragments it requires (but not from optional bundles)

好处还包括OSGi的版本方面,它允许指定依赖项的最小和最大预期版本.

The benefits also include the version aspect of OSGi, which allows to specify the minimum and maximum expected version of a dependency.

这篇关于我应该使用Eclipse插件(或OSGi捆绑软件)作为普通的依赖项管理工具吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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