0

I have an Eclipse plugin containing a resource file (resource.xml) which is loaded by the source code. This plugin is used in two applications, one base and one derivative, and I want to use a different resource.xml file in the derivative application.

I've been investigating Eclipse fragments as a possible way of doing this, but all results my research has turned up either described how to replace .class files or have only described fragments at a very abstract level.

Now I ask, is there a way to do this using fragments, or am I investigating a dead end?

Bearmarshal
  • 115
  • 4

1 Answers1

2

Probably the best way is to use two fragments with the two resource.xml files in these fragments. You would only include one of the fragments in each application. The parent ('host') plug-in would not include the resource.xml at all.

You need to be sure to use the appropriate APIs (such as FileLocator) to find the resource.xml so that the fragments are searched.

greg-449
  • 109,219
  • 232
  • 102
  • 145
  • I eventually ended up going down a different route altogether, as putting the original resource in a fragment turned out to not be an option for me, but I'm accepting this solution anyway as the solution to my original inquiry. – Bearmarshal Feb 27 '17 at 08:31