现在有个微服务项目,里面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注释
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.pluginsgroupId>
- <artifactId>maven-compiler-pluginartifactId>
- <version>3.8.1version>
- <configuration>
- <source>1.8source>
- <target>1.8target>
- <encoding>UTF-8encoding>
- configuration>
- plugin>
-
- plugins>
- build>
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