问题描述
我有一个 Eclipse 插件项目,它依赖于我的 Eclipse 中的 java 项目.通常我所做的是将项目导出为 jar 并在插件中按原样使用它.但这需要手工工作.我可以从我的插件项目中获得一个 Java 项目的引用,该项目将同时是编译时和运行时依赖项吗?
我看到了 类似问题,但并不完全相同.
I have an eclipse plugin project which dependes on java project in my eclipse. usually what I did is export the project as jar and use it as-is in the plugin. but this requires manual work. can I have a reference from my plugin projct to a java project that will be both compile-time and run-time dependency ?
I saw a similar question, but not exactly the same.
推荐答案
我认为,最接近此的方法是从引用的项目创建一个 jar 文件,并将其导入到项目存储库中.但这对于当前开发的项目来说很难管理.
I think, the closest thing to this is to create a jar file from the referenced project, and import it to the projects repository. But thats quite hard to manage for a currently developed project.
另一方面,是否可以简单地将Java项目永久转换为插件?如果其他用户不使用 OSGi/Eclipse,他/她只会在 java 项目特定的东西旁边看到一个 manifest/manifest.mf 文件(可能还有一个 plugin.xml),所以这不会打扰他们,但会有所帮助你.
On the other hand, isn't it possible to simply convert the Java project into a plug-in permanently? If the other user does not use OSGi/Eclipse, he/she will see only a manifest/manifest.mf file (and possibly a plugin.xml) next to the java project specific stuff, so this would not disturb them, but would help you.
这篇关于eclipse插件项目可以依赖java项目吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!