maven 打jar 被引用后 出现 cannot resolve symbol 错误 生成jar包形式代码文件组织格式 非springboot文件组织格式

项目A引用项目B

A项目中pom引入没有报错,但是:
1,idea里面查找到b项目中的代码时,会提示b代码中的引用不正确。提示无法解析语法

解压B的jar,发现目录是:

springboot文件组织格式

 

要把文件打包到BOOT-INF外才能正确的引用到打包出的文件。

jar文件组织格式

路径不对,解决办法:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>


在B项目的pom里面加上这个,会去掉BOOT-INF目录,直接代码目录就在外面。

 

原文地址:https://www.cnblogs.com/hfultrastrong/p/9845278.html