SpringBoot多模块中Service模块无法加载Entity模块程序包

Service模块能够正常调用Entity模块方法,但是一到统一打包的时候发现Entity某个程序包不存在

这种原因导致的原因是Entity本身不能通过Maven打包成可执行包。

我们可以把Entity打成可以执行的包就不会出现上述问题了。

<plugins>
	<plugin>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-maven-plugin</artifactId>
		<configuration>
			<mainClass>com.jd.entity.EntityApplication</mainClass>
			<classifier>exec</classifier>
		</configuration>
	</plugin>
</plugins>

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注