I didn't understand the difference between package and install before, but I tested it today.
If the b project depends on the a project, and the a package (package), the jar only hits the target of the a project. At this time, when project b is compiled, an error will still be reported, and the project a that it depends on cannot be found, indicating that project b has not found the project a it depends on in the local warehouse. Then, when I install a project, there are the following logs, [INFO] Installing G:\projects\a\target\a-0.0.1-SNAPSHOT.jar to F:\repository\com\chenjun\a\0.0.1 -SNAPSHOT\a-0.0.1-SNAPSHOT.jar
[INFO] Installing G:\projects\a\pom.xml to F:\repository\com\chenjun\a\0.0.1-SNAPSHOT\a-0.0.1- SNAPSHOT.pom, indicating that the a project has been installed in the local warehouse, and the jar and pom are installed at the same time.
At this time, go to the compileb project and compile the .
In short, package is to put the jar under the target of this project, and install the jar under the target to the local warehouse for use by other projects.