MiraiForum

    • Register
    • Login
    • Search
    • Popular
    • Recent
    • Unsolved
    • Tags
    • Groups
    • 友情链接

    Spring Boot Mirai

    插件发布
    5
    12
    777
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cssxsh
      cssxsh last edited by cssxsh

      Spring Boot 3.0 前置插件

      注意 本插件具有一定的娱乐兴致,不喜勿喷

      Mirai Console 的前置插件,用于 Spring Boot 的初始化

      maven-central

      引用方法请看 https://github.com/cssxsh/spring-boot-mirai#readme

      安装

      MCL 指令安装

      请确认 mcl.jar 的版本是 2.1.0+
      ./mcl --update-package xyz.cssxsh.mirai:spring-boot-mirai-starter --channel maven-stable --type plugin

      手动安装

      1. 从 Releases 或者 Maven 下载 mirai2.jar
      2. 将其放入 plugins 文件夹中
      1 Reply Last reply Reply Quote 1
      • 小仙-老师
        小仙-老师 last edited by

        占个楼,是在mirai中可以使用Spring boot框架了吗

        cssxsh 1 Reply Last reply Reply Quote 0
        • cssxsh
          cssxsh @小仙-老师 last edited by

          @小仙-老师

          一直都可以,只是你们不会玩
          而且spring 是大型框架,不建议塞到 mirai

          如果 mirai 是汽车,那 spring 就是火车

          汽车拉火车怎么想都别扭
          这个只是写着玩

          小仙-老师 1 Reply Last reply Reply Quote 0
          • RainChan
            RainChan 摸鱼 last edited by

            感觉做个好用的spring boot的starter更好一些

            cssxsh 2 Replies Last reply Reply Quote 0
            • cssxsh
              cssxsh @RainChan last edited by

              @RainChan

              不太懂
              这个项目现在只是 init 中

              RainChan 1 Reply Last reply Reply Quote 0
              • RainChan
                RainChan 摸鱼 @cssxsh last edited by

                可以看看我之前停止维护的项目
                https://github.com/mzdluo123/mirai-spring-boot-starter
                只需要导入这个依赖到spring boot应用里就能基于spring框架开发mirai应用了

                1 Reply Last reply Reply Quote 0
                • cssxsh
                  cssxsh @RainChan last edited by cssxsh

                  @RainChan

                  很多人想把spring塞进插件,但是又不会处理,所以打算整个前置
                  我这个是作为前置插件。写着玩的,
                  顺便练手一下 Spring Boot 3.0

                  1 Reply Last reply Reply Quote 0
                  • 小仙-老师
                    小仙-老师 @cssxsh last edited by

                    @cssxsh Java学到接口和异常了能勉强写一个简单的插件了吗 💖

                    1 Reply Last reply Reply Quote 0
                    • H
                      hatmony 摸鱼 last edited by

                      引入 mirai-core-jvm 就能写一个spring boot 的starter 项目了,打完包一键启动,我1核2G的云服务器跑起来也毫无压力,参考 https://gitee.com/nekotori/neko-qqbot

                      1 Reply Last reply Reply Quote 1
                      • G
                        GuXianWN last edited by

                        为啥我的springboot 引入mirai-core:2.13.0 润不起来
                        mirai-core降版本就可以跑

                        Error creating bean with name 'init' defined in class path resource [com/guxian/mirai/BotService.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [net.mamoe.mirai.Bot]: Factory method 'init' threw exception; nested exception is java.util.ServiceConfigurationError: net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated

                        cssxsh 2 Replies Last reply Reply Quote 0
                        • cssxsh
                          cssxsh @GuXianWN last edited by

                          @GuXianWN
                          https://github.com/mamoe/mirai/issues/2308

                          SugarFatFree created this issue in mamoe/mirai

                          open 启动报错 net.mamoe.mirai.IMirai: Provider net.mamoe.mirai.internal.MiraiImpl could not be instantiated #2308

                          1 Reply Last reply Reply Quote 0
                          • cssxsh
                            cssxsh @GuXianWN last edited by cssxsh

                            @GuXianWN

                            另外目前这个 spring-boot-mirai-starter 加载 其他插件的 config 是有问题的,并不能正常工作

                            我想等 spring boot 3.0 正式发布,再尝试修复他

                            1 Reply Last reply Reply Quote 0
                            • 1 / 1
                            • First post
                              Last post
                            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact