Eclipse PDE:如何将 java 项目的类路径添加到插件的类路径?

发布于 2024-09-29 18:46:37 字数 199 浏览 3 评论 0原文

大家,

我已经搜索了很多,但没有找到答案。

我做了一个 eclipse 插件,它从源代码编写 junit 测试用例。

到现在为止,我开始在代码中使用反射,但是插件找不到正在测试的java项目中的类!

有没有办法在我的插件中使用选定的项目类路径?如何??

我见过很多像我这样的问题,但没有答案。请有人帮忙!

People,

I already searched a lot but I'm not finding my answer..

I did a eclipse plugin that writes junit test cases from source code.

By now, I'm starting to use reflection in my code, but the plugin can't find the classes in the java project being tested!

Is there a way to use the selected project classpath in my plug-in? How??

I've seen many questions like mine out there, but with no answers. Please someone help!

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

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

发布评论

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

评论(1

万劫不复 2024-10-06 18:46:37

您也许可以尝试以编程方式编写启动配置,其中在类路径中包含插件源代码和项目源代码。

通过这种方式,您应该为您的应用程序提供一个有效的入口点。

这篇文章解释了如何

否则你可以尝试根据你的eclipse jdt 上的插件使用 jdt 提供的抽象语法树来生成单元测试。

参考 eclipsepedia

you could perhaps try to write programmatically a launch configuration that includes in the classpath both your plugin source code and the project source code.

By doing this way you should provide a valid entry point to your application.

this article explains how

Otherwise you could try to base your plugin on eclipse jdt using the Abstract Syntax Tree that jdt provides to generate the unit tests.

ref eclipsepedia

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