apache-dubbo下的依赖报错

apache-dubbo下的依赖报错

https://img1.sycdn.imooc.com//climg/61b15bdc0901e3bf18830800.jpg

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.imooc</groupId>
    <artifactId>dubbo-practice</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <modules>
        <module>producer</module>
    </modules>
<parent>
    <artifactId>spring-boot-starter-parent</artifactId>
    <groupId>org.springframework.boot</groupId>
    <version>2.1.12.RELEASE</version>
    <relativePath/>
</parent>
    <groupId>com.imooc</groupId>
    <artifactId>dubbo-practice</artifactId>
    <version>0.0.1</version>
    <name>dubbo-practice</name>
    <description>Demo project for Spring Boot</description>
    <properties>
        <java.version>1.8</java.version>
        <spring-boot.version>2.1.12.RELEASE</spring-boot.version>
        <dubbo.version>2.7.4.1</dubbo.version>
    </properties>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <!--Apache Dubbo-->
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo-dependencies-bom</artifactId>
                <version>${dubbo.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.dubbo</groupId>
                <artifactId>dubbo</artifactId>
                <version>${dubbo.version}</version>

                <exclusions>
                    <exclusion>
                        <groupId>org.springframework</groupId>
                        <artifactId>spring</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>javax.servlet</groupId>
                        <artifactId>servlet-api</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

</project>


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

4回答
大吉他 2022-03-26 21:34:50
在<dependencyManagement>外面加上
<dependencies>
    <dependency>
        <groupId>org.apache.dubbo</groupId>
        <artifactId>dubbo</artifactId>
    </dependency>
</dependencies>


精慕门58964 2021-12-13 15:34:19

我觉得你可以下载对应的依赖,设置到本地仓库中。https://www.pianshen.com/article/3418362277/  

好帮手慕小脸 2021-12-10 15:34:52

同学你好,根据同学贴出的图片,dubbo依赖并没有被成功加载,建议更换依赖版本,然后右侧刷新重新下载

https://img1.sycdn.imooc.com//climg/61b30290096ff01705180154.jpg

注:如果右下角有加载条,说明正在下载,同学需要耐心等待

祝学习愉快~


  • 提问者 qq_慕神0589333 #1

    换了几次还是加载不出dubbo

    2021-12-10 17:12:43
  • 好帮手慕小脸 回复 提问者 qq_慕神0589333 #2

    同学你好,如果还不可以,同学可以在pom.xml中添加如下配置试试

    <repositories>
        <repository>
            <id>aliyun</id>
            <name>aliyun</name>
            <url>https://maven.aliyun.com/repository/public</url>
        </repository>
    </repositories>

    添加后再次刷新maven试试

    祝学习愉快~

    2021-12-10 18:30:19
  • 提问者 qq_慕神0589333 回复 好帮手慕小脸 #3

    还是不行哦,没有变化与之前


    2021-12-12 17:01:09
好帮手慕小脸 2021-12-09 11:08:47

同学你好,建议同学去本地仓库将上述两个依赖删除,然后回到Idea右侧点击项目选择Maven--Reimport进行重新导入试一下

https://img1.sycdn.imooc.com//climg/61b1730709171e7006570179.jpg

https://img1.sycdn.imooc.com//climg/61b173220973ca1206040235.jpg

祝学习愉快~

  • 提问者 qq_慕神0589333 #1

    apache目录下是没有dubbo文件目录

    2021-12-09 11:54:04
  • 好帮手慕小脸 回复 提问者 qq_慕神0589333 #2

    同学你好,如果没有,尝试点击右侧Maven进行刷新加载依赖试一下

    https://img1.sycdn.imooc.com//climg/61b19d780919ccfa02090088.jpg

    祝学习愉快~

    2021-12-09 14:08:58
  • 提问者 qq_慕神0589333 回复 好帮手慕小脸 #3

    不知怎么复制的资料里的就加载了,但是dubbo还是报错,这里少东西吗

    https://img1.sycdn.imooc.com//climg/61b21bc40922aa2307550380.jpg


    https://img1.sycdn.imooc.com//climg/61b21c0609b1d3ae15000930.jpg



    2021-12-09 23:08:57
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师