MiraiForum

    • 注册
    • 登录
    • 搜索
    • 热门
    • 最新
    • 未解决
    • 标签
    • 群组
    • 友情链接

    Spring Boot Mirai

    插件发布
    5
    12
    1546
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • cssxsh
      cssxsh 最后由 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 条回复 最后回复 回复 引用 1
      • 小仙-老师
        小仙-老师 最后由 编辑

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

        cssxsh 1 条回复 最后回复 回复 引用 0
        • cssxsh
          cssxsh @小仙-老师 最后由 编辑

          @小仙-老师

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

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

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

          小仙-老师 1 条回复 最后回复 回复 引用 0
          • RainChan
            RainChan 摸鱼 最后由 编辑

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

            cssxsh 2 条回复 最后回复 回复 引用 0
            • cssxsh
              cssxsh @RainChan 最后由 编辑

              @RainChan

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

              RainChan 1 条回复 最后回复 回复 引用 0
              • RainChan
                RainChan 摸鱼 @cssxsh 最后由 编辑

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

                1 条回复 最后回复 回复 引用 0
                • cssxsh
                  cssxsh @RainChan 最后由 cssxsh 编辑

                  @RainChan

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

                  1 条回复 最后回复 回复 引用 0
                  • 小仙-老师
                    小仙-老师 @cssxsh 最后由 编辑

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

                    1 条回复 最后回复 回复 引用 0
                    • H
                      hatmony 摸鱼 最后由 编辑

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

                      1 条回复 最后回复 回复 引用 1
                      • G
                        GuXianWN 最后由 编辑

                        为啥我的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 条回复 最后回复 回复 引用 0
                        • cssxsh
                          cssxsh @GuXianWN 最后由 编辑

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

                          SugarFatFree created this issue in mamoe/mirai

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

                          1 条回复 最后回复 回复 引用 0
                          • cssxsh
                            cssxsh @GuXianWN 最后由 cssxsh 编辑

                            @GuXianWN

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

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

                            1 条回复 最后回复 回复 引用 0
                            • 1 / 1
                            • First post
                              Last post
                            Powered by Mamoe Technologies & NodeBB | 友情链接 | 服务监控 | Contact