I’m using Maven to build an Eclipse plugin.
The plugin has a few 3rd party libraries included. They all build fine, but at runtime I get a bunch of java.lang.NoClassDefFoundError exceptions.
The libraries are stored in the Maven repository and referenced as “Variable Libraries”.
For example:
M2_REPO/com/miglayout/miglayout-core/4.1/miglayout-core-4.1.jar
When I copy the files to a project specific lib/ folder and add those jars to the Eclipse plugin runtime, everything works fine. However, if I do not copy those jars to an internal lib/ and use the references to the Maven repository then the classes cannot be found at runtime.
You should take a look at Tycho, which is a Maven extension to help you build Eclipse plugins.
http://www.eclipse.org/tycho/