mercredi 20 juillet 2016

Eclipse PDE: Reflections Library not finding packages

The org.reflections library does not function correctly when it's used inside an Eclipse Plugin project.

For instance, the following code should return all classes of a given subtype in a given package:

Reflections reflections = new Reflections("my.package");
Set<Class<? extends Subtype>> classes = reflections.getSubTypesOf(Subtype.class);

When running the project as a Plugin, classes will be empty. Inserting a main() and running it as a normal Java application will correctly return the expected classes.

I've tried to:

Include the Reflections library as a normal third-party jar dependency

Include the Reflections library as an OSGi bundle (http://ift.tt/2afGKNd)





Aucun commentaire:

Enregistrer un commentaire