未解决 Cannot find plugin description resource 'plugin.yml'
-
mirai-console 2.12.3版本
插件打包后放入plugins并运行控制台报错
错误信息如题,找不到plugin.yml下面是插件主类,按照官方文档写的
public static final DemoPlugin INSTANCE = new DemoPlugin(); private DemoPlugin() { super(JvmPluginDescription.loadFromResource()); }
打包后的classpath下也确实是存在plugin.yml的。如图
-
-
et.mamoe.mirai.console.internal.util.ServiceLoadException: Could not load service cn.cimoc.mirai.plugin.AutoPlanPlugin. at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:60) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadAllServices(PluginServiceHelper.kt:42) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:170) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:165) at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:314) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:307) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786) at kotlin.sequences.SequencesKt___SequencesKt.toSet(_Sequences.kt:827) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.extractPlugins(BuiltInJvmPluginLoaderImpl.kt:191) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.listPlugins(BuiltInJvmPluginLoaderImpl.kt:66) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.listPlugins(JvmPluginLoader.kt) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.listAndSortAllPlugins(PluginManagerImpl.kt:192) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.findAndSortAllPluginsUsingBuiltInLoaders(PluginManagerImpl.kt:138) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadAllPluginsUsingBuiltInLoaders$mirai_console(PluginManagerImpl.kt:148) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:178) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:464) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:168) at cn.cimoc.mirai.Pro1Application.main(Pro1Application.java:17) Caused by: java.lang.ExceptionInInitializerError at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:51) ... 22 more Caused by: java.lang.IllegalStateException: Cannot find plugin description resource 'plugin.yml' at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource(JvmPluginDescription.kt:51) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource$default(JvmPluginDescription.kt:45) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource(JvmPluginDescription.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription.loadFromResource(JvmPluginDescription.kt) at mirai-autoplan-1.0.jar//cn.cimoc.mirai.plugin.AutoPlanPlugin.<init>(AutoPlanPlugin.java:24) at mirai-autoplan-1.0.jar//cn.cimoc.mirai.plugin.AutoPlanPlugin.<clinit>(AutoPlanPlugin.java:17) ... 25 more Process finished with exit code 0
-
@oneoness 在 Cannot find plugin description resource 'plugin.yml' 中说:
et.mamoe.mirai.console.internal.util.ServiceLoadException: Could not load service cn.cimoc.mirai.plugin.AutoPlanPlugin. at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:60) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadAllServices(PluginServiceHelper.kt:42) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:170) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl$extractPlugins$findAllInstances$2.invoke(BuiltInJvmPluginLoaderImpl.kt:165) at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:314) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214) at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:307) at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303) at kotlin.sequences.SequencesKt___SequencesKt.toCollection(_Sequences.kt:786) at kotlin.sequences.SequencesKt___SequencesKt.toSet(_Sequences.kt:827) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.extractPlugins(BuiltInJvmPluginLoaderImpl.kt:191) at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.listPlugins(BuiltInJvmPluginLoaderImpl.kt:66) at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.listPlugins(JvmPluginLoader.kt) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.listAndSortAllPlugins(PluginManagerImpl.kt:192) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.findAndSortAllPluginsUsingBuiltInLoaders(PluginManagerImpl.kt:138) at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.loadAllPluginsUsingBuiltInLoaders$mirai_console(PluginManagerImpl.kt:148) at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:178) at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:464) at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:168) at cn.cimoc.mirai.Pro1Application.main(Pro1Application.java:17) Caused by: java.lang.ExceptionInInitializerError at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Class.java:398) at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:51) ... 22 more Caused by: java.lang.IllegalStateException: Cannot find plugin description resource 'plugin.yml' at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource(JvmPluginDescription.kt:51) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource$default(JvmPluginDescription.kt:45) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription$Companion.loadFromResource(JvmPluginDescription.kt) at net.mamoe.mirai.console.plugin.jvm.JvmPluginDescription.loadFromResource(JvmPluginDescription.kt) at mirai-autoplan-1.0.jar//cn.cimoc.mirai.plugin.AutoPlanPlugin.<init>(AutoPlanPlugin.java:24) at mirai-autoplan-1.0.jar//cn.cimoc.mirai.plugin.AutoPlanPlugin.<clinit>(AutoPlanPlugin.java:17) ... 25 more Process finished with exit code 0
这里包名和问题里的不一样是因为重新建了一个项目