微服务多模块项目maven打包时报找不到依赖模块中的类

现在有个微服务项目,里面ServiceProvider模块依赖Common模块,依赖是这么添加的



    com.figo
    Common
    0.0.1-SNAPSHOT

正常的开发调试时没有问题,但是通过mvn打包时报错:

[WARNING] The POM for com.figo:Common:jar:0.0.1-SNAPSHOT is missing, no dependency information available

    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ServiceProvider: Compilation failure: Compilation failure:
[ERROR] /E:/IdeaProjects/UPPoint/PointServiceProvider/src/main/java/com/figo/serviceprovider/controller/TestController.java:[3,38] 程序包com.figo.common.utils不存在

解决办法:

1.Common模块pom.xml里面build需要将spring-boot-maven-plugin注释


        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                3.8.1
                
                    1.8
                    1.8
                    UTF-8
                
            
            
        
    

2.先打Common包

E:\IdeaProjects\MyProject\Common>mvn clean install -Dmaven.skip.test=true

3.再打ServiceProvider包

E:\IdeaProjects\MyProject\ServiceProvider>mvn clean install -Dmaven.skip.test=true

你可能感兴趣的:(微服务,微服务,java,前端)