Код: Выделить всё
root/
├── pom.xml
├── shared/
│ └── pom.xml
├── app1/
│ └── pom.xml
├── app2/
│ └── pom.xml
└── app3/
└── pom.xml
< /code>
Мой корневой помпон похож на это: < /p>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
org.springframework.boot
spring-boot-starter-parent
3.4.2
pom
br.com.root
root
0.0.1
root
Root
shared
app1
app2
app3
21
3.4.2
org.springframework.boot
spring-boot-dependencies
${spring.boot.version}
pom
import
< /code>
Мой общий POM такой: < /p>
4.0.0
br.com.root
root
0.0.1
../pom.xml
br.com.api
shared
0.0.1-SNAPSHOT
shared
Shared App
21
org.springframework.boot
spring-boot-autoconfigure
org.springframework.boot
spring-boot-maven-plugin
repackage
repackage
Код: Выделить всё
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
br.com.root
root
0.0.1
../pom.xml
br.com.api
app1
0.0.1-SNAPSHOT
app1
App 1
21
br.com.api
shared
0.0.1-SNAPSHOT
org.springframework.boot
spring-boot-test
test
junit
junit
test
org.junit.jupiter
junit-jupiter-api
5.10.5
test
org.apache.maven.plugins
maven-compiler-plugin
org.projectlombok
lombok
org.springframework.boot
spring-boot-maven-plugin
org.projectlombok
lombok
Код: Выделить всё
[INFO] shared ............................................. SUCCESS [ 1.787 s]
[INFO] app1 ............................................... FAILURE [ 0.692 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.786 s
[INFO] Finished at: 2025-01-25T17:47:29-03:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:compile (default-compile) on project app1: Compilation failure
[ERROR] /C:/Users/MyUser/dev/spring boot/multi-module-app/app1/src/main/java/br/com/api/app1/App1Application.java:[3,32] package br.com.api.shared.domain does not exist
Подробнее здесь: https://stackoverflow.com/questions/793 ... pring-boot
Мобильная версия