MiraiForum

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

    使用Maven基于core开发的时候究竟要导入哪些包

    开发交流
    3
    3
    284
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • W
      WaviFreka 最后由 编辑

      core的api文档中并没有写明要使用哪些包。
      我在导入了以下包之后仍然提示找不到类:

              <dependency>
                  <groupId>net.mamoe</groupId>
                  <artifactId>mirai-core-jvm</artifactId>
                  <version>2.8.2</version>
                  <type>pom</type>
              </dependency>
      
              <dependency>
                  <groupId>net.mamoe</groupId>
                  <artifactId>mirai-core-api-jvm</artifactId>
                  <version>2.8.2</version>
                  <type>pom</type>
              </dependency>
      
              <dependency>
                  <groupId>net.mamoe</groupId>
                  <artifactId>mirai-core-utils-jvm</artifactId>
                  <version>2.8.2</version>
                  <type>pom</type>
                  <scope>runtime</scope>
              </dependency>
      

      35c06939-a74f-41d7-abd2-88a2f0c4a213-image.png

      1 条回复 最后回复 回复 引用 0
      • Q
        qibao 最后由 编辑

        	我目前还没有使用到2.8.2,所以是这样:
                    <!-- mirai核心 -->
        	<dependency>
        		<groupId>net.mamoe</groupId>
        		<artifactId>mirai-core-jvm</artifactId>
        		<version>2.7.1</version>
        		<!-- <type>pom</type> -->
        	</dependency>
                   如果是使用gradle的话,我的是这样的:
                   plugins(
                            id 'java'
                            id 'org.jethrains.jvm' version '1.5.10'
                   )
                   dependencies(
                            api group: 'net.mamoe',name:'mirai-core',version:'2.7.1'
                   )
                   你否在在本地安装了Maven或者尝试过使用mvn install呢?
        
        1 条回复 最后回复 回复 引用 0
        • wssy001
          wssy001 ⭐2021⭐ 最后由 编辑

          如果是2.8.2,用java写的话,只需导入:

                  <dependency>
                      <groupId>net.mamoe</groupId>
                      <artifactId>mirai-core-jvm</artifactId>
                      <version>2.8.2</version>
                  </dependency>
          

          如果是springboot,还需注意mirai依赖的kotlin版本和springboot自带的kotlin依赖的版本

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