No suitable classloader found for grab

前端 未结 7 1405
梦毁少年i
梦毁少年i 2020-12-06 10:13

I have this at the beginning of a class:

@Grab(group = \'org.ccil.cowan.tagsoup\', module = \'tagsoup\', version = \'1.2\')
class MyClass{...
7条回答
  •  既然无缘
    2020-12-06 10:32

    There's one more solution for testing a class with @Grab annotation:

    1. Extract an interface from this class.
    2. Create another class which implements its interface. Move the @Grab annotation to this class. Then make this class a simple wrapper, which just passes all the messages to the original class.
    3. Run the tests against your original class.
    4. Whenever you need to have a version @Grab, use the wrapper.

提交回复
热议问题