多模块依赖中,找不到依赖: 程序包xxx.xxx.xxx不存在

 下文是解决这个问题的网上文章


目录大概就是这样:
project

service1
common
pom.xml

我在service1模块里依赖了common模块,开发的时候包都能正常引用到,启动也能正常测试访问,可是奇怪的是,当我要打包成jar包时,就提示service1里依赖common的包都不存在,之前从没遇到过这种问题,有清楚这是什么原因造成的吗???

进一步测试问题,初步发现问题

那就是在公共模块common里不要引入下面这个:

<build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

 

引入上面的配置,其他模块在引入这个common时会导致打包时找不到common的包

maven  build知识需要课后补充

 

猜你喜欢

转载自www.cnblogs.com/asplover/p/13385749.html