The BOOT project relies on another module’s package, which is normal during development. When clean package is packaged into jar, it is prompted that the dependent module package does not exist.

  java, question

This is probably the directory:
Project

service1
 Common
 pom.xml

I rely on the common module in the service1 module inside, and the packages can be referenced normally during development and can be tested and accessed normally during startup. However, it is strange that when I want to package into jar packages, I will prompt service1 inside that the packages that rely on common do not exist. I have never encountered such a problem before. Is it clear what causes this? ? ?

Further testing of the problem and initial discovery of the problem

That is, do not introduce the following in the common module inside:

<build>
 <plugins>
 <plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>
 </plugin>
 </plugins>
 </build>

With the above configuration introduced, other modules will not find the common package when packaging this common.

The problem is solved by adding the following configuration to common inside:

<build>
 <plugins>
 <plugin>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-maven-plugin</artifactId>
 </plugin>
 </plugins>
 </build>

Just remove the above code, probably if A depends on B, then B should not have the above configuration, A can have it.