2

I have to develop an Engineering tool for my organization, whereby the task is to call the Eclipse plugin like findbug, PMD from the Java Application. Actually this a part of POC that i need to develop. Can anyone let me know or have anyone tried to call/invoke the plugin from the Java code ?

Please let me now if anyone has a way or tried that.

Thanks. in advance.

Daniel Darabos
  • 26,991
  • 10
  • 102
  • 114
Nayan
  • 578
  • 7
  • 13
  • What you mean "from the java code"? from the build process? from another eclipse plugin? – Simone Gianni Sep 08 '14 at 11:13
  • Hi Simone,from "Java code" means i need to invoke it from the standalone java application. This is just a part of POC. Actually tools has something more to offer than these. – Nayan Sep 08 '14 at 11:14
  • You cannot call most Eclipse plugins from a normal Java application because they rely on the Eclipse/OSGi plugin infrastructure created during Eclipse startup. – greg-449 Sep 08 '14 at 11:16
  • Thanks for the reply Greg.Let me tell you the overall scope of the tool. What i want to do is, when the user save the file for eg: .java file, i need to invoke these plugin (findbug, PMD etc) so that code quality checks are performed and the user get warned about the possible quality issues. Is there a way to achieve these? – Nayan Sep 08 '14 at 11:17
  • @Nayan are you trying to create a new plugin for your POC? Are you trying to change functionality of existing plugin(firebug, PMD) as a POC? – kensen john Sep 08 '14 at 11:31
  • Hi Kensen, Thanks for the reply. No i am not trying to change the existing functionality of plugin (firebug, PMD). Yes i am creating a new POC for the requirement in my above comment. – Nayan Sep 08 '14 at 11:35
  • 1
    If you want to use Eclipse plugins like this you need to write an Eclipse Rich Client Program (RCP). – greg-449 Sep 08 '14 at 12:09
  • 1
    Hi Greg, Thanks for the reply. Can you please give more pointers on Eclipse Rich Client Program (RCP) and how to use it ? – Nayan Sep 08 '14 at 12:28
  • For example, [SpotBugs, the successor of FindBugs, can also be called as Ant task](https://spotbugs.readthedocs.io/en/latest/ant.html). This should also allow calling it from a standalone Java application. But why do you need that? For the mentioned validation tools there are Eclipse plugins showing error markers on save and they can also be run in a (Maven) build. So what are you missing? Are you aware of [SonarLint](https://marketplace.eclipse.org/content/sonarlint)? – howlger Sep 16 '22 at 12:05
  • @daniel-darabos Most Eclipse code is separated in non-Eclipse-specific and Eclipse-specific plugins (mostly with the extension `.ui`) for that purpose. There are even separate projects of non-Eclipse-specific vs. Eclipse-specific Eclipse projects, for instance JGit/EGit or LSP4J/LSP4E. `Platform.getBundle(x)` is Eclipse-specific. Turning an application into an Eclipse-based application should be problem either. – howlger Sep 20 '22 at 07:15

0 Answers0