想在自己的插件中导入一个dom4j.jar包,否则通过不了编译,除了wrapped library plugin方式,难道没其他的办法了吗 ,在书上找了一段:
A JAR can be added to the classpath of a plug-in in four ways.
- The JAR can be added to the boot classpath. This is generally a bad idea, however, as it requires an extra VM argument, and it also affects the classpath of all other installed plug-ins. If the JAR adds types—classes or interfaces—that mask types declared in other plug-ins, you will probably break those other plug-ins. Nonetheless, if you are looking for a quick and dirty hack, this is the easiest approach.
- The JAR can be added to the declared libraries for a plug-in. This is fine if you don’t anticipate a need for other plug-ins also to use that JAR.
- A new plug-in can be created that is a wrapper for the library; then the new plug-in is added to the list of required plug-ins for all plug-ins that want access to the library.
- The OSGi parent loader can be changed by setting the osgi.parentClassloader system property on startup. This is also generally a bad idea, for the same reasons listed for changing the boot classpath.
好像第二种满足要求,但哪位知道怎么设置?