tiger_in_hand 2022-03-28 17:06 采纳率: 100%
浏览 109
已结题

Maven中已引入的依赖显示不存在的问题.

问题遇到的现象和发生背景

项目中有一个公共模块,项目内的其他模块引入了该公共模块.公共模块install时是没有问题的,其中也有用到lombok和mybatisplus的相关注解.而引用此公共类的其他模块package和Install时则显示lombok中的相关包不存在.
公共模块和出现此问题的一个模块pom文件如下.
公共模块,其中某些引用的第三方依赖没有列出来.

<?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">
    <parent>
        <groupId>com.xxx</groupId>
        <artifactId>xxx-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>xxx-common</artifactId>
    <packaging>jar</packaging>

<dependencies>
    <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
            <version>3.3.1.tmp</version>
        </dependency>

<dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

</dependencies>



    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.4.RELEASE</version>
                <executions>
                    <execution>
                        <phase>none</phase>
                    </execution>
                </executions>
                <configuration>
                    <classifier>execute</classifier>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <testFailureIgnore>true</testFailureIgnore>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

引用此公共类的某一模块

<?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">
     <parent>
        <groupId>com.xxx</groupId>
        <artifactId>xxx-parent</artifactId>
        <version>1.0-SNAPSHOT</version>
    </parent>
    <modelVersion>4.0.0</modelVersion>

    <artifactId>xxx_xxxxx</artifactId>
    <packaging>jar</packaging>

    <dependencies>

        <dependency>
            <groupId>com.xxx</groupId>
            <artifactId>xxx-common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>


    </dependencies>

</project>

问题相关代码,请勿粘贴截图
运行结果及报错内容
我的解答思路和尝试过的方法

仓库设置的应该没问题,也有勾选delegate ide build/run actions to maven 尝试,还是没有成功.
相同项目的另一个升级过springboot和springcloud的版本则没有此问题.此版本是升级之前的.也有尝试删除掉所有的依赖并重新下载,因为项目是在内网,只有通过内网的公共仓库,下载的时候没有相关报错,应该不是包的问题.maven中也没有依赖的爆红.

我想要达到的结果
  • 写回答

2条回答 默认 最新

  • tiger_in_hand 2022-04-08 19:28
    关注

    换了一个本地仓库地址并重新对根目录install,最终成功解决.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 4月16日
  • 已采纳回答 4月8日
  • 创建了问题 3月28日

悬赏问题

  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗
  • ¥15 运动想象脑电信号数据集.vhdr
  • ¥15 三因素重复测量数据R语句编写,不存在交互作用
  • ¥15 微信会员卡等级和折扣规则
  • ¥15 微信公众平台自制会员卡可以通过收款码收款码收款进行自动积分吗
  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了