工程中子项目order-service 依赖 feign-api
feign-api打包时会提示 Unable to find main class
order-service 打包时会提示 程序包feign.clients不存在
解决方法:
被依赖工程feign-api中pom.xml文件中加入以下代码
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<layout>NONE</layout> <!-不打包可执行jar,不扫描main函数-->
<classifier>exec</classifier>
</configuration>
</plugin>
依赖feign-api的order-service项目中的pom.xml文件加入代码
<build>
<finalName>app</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>