Я пытаюсь перенести проект Spring Boot, который я начал разрабатывать без модулей, на архитектуру Java 9 Jigsaw.
Не могу понять почему, но при создании моего service модуль, который зависит от моих common модулей, классы common недоступны.
Примечание: все мои файлы mod-info.java находятся в папке src/main/java в каждом модуле.
Заранее спасибо, я не знаю что не так с моей конфигурацией...
Вот что я получаю, когда пытаюсь выполнить чистую установку mvn< /code> в корневой папке проекта:
...
[INFO] 54 errors
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] server 0.0.1-SNAPSHOT .............................. SUCCESS [ 2.449 s]
[INFO] common ............................................. SUCCESS [ 4.242 s]
[INFO] service ............................................ FAILURE [ 3.058 s]
[INFO] api 0.0.1-SNAPSHOT ................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.602 s
[INFO] Finished at: 2018-03-25T18:40:01+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project service: Compilation failure: Compilation failure:
[ERROR] /D:/lastfm-playlists-workspace/lastfm-playlists-server/service/src/main/java/com/lastfm/playlists/server/service/api/converter/lastfm/common/LastfmApiTrackDto_to_LovedTrackDto_Converter.java:[3,55] package com.lastfm.playlists.server.common.model.lastfm does not exist
...
Вот мой основной pom.xml:
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
com.lastfm.playlists
server
0.0.1-SNAPSHOT
api
service
common
pom
server
Demo project for Spring Boot
org.springframework.boot
spring-boot-starter-parent
2.0.0.RELEASE
UTF-8
UTF-8
1.9
1.9
9
1.16.21
org.springframework.boot
spring-boot-starter-data-mongodb
org.springframework.boot
spring-boot-starter-web
org.springframework.boot
spring-boot-starter-test
test
org.projectlombok
lombok-edge
${lombok.version}
org.springframework.boot
spring-boot-maven-plugin
com.lastfm.playlists.server.api.Application
maven-compiler-plugin
3.7.0
9
9
true
true
Мой общий модуль pom.xml:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
server
com.lastfm.playlists
0.0.1-SNAPSHOT
4.0.0
com.lastfm.playlists.server
common
jar
common
Связанный модуль-info.java:
module common {
requires slf4j.api;
requires jackson.annotations;
requires lombok;
requires spring.data.commons;
requires spring.data.mongodb;
requires java.validation;
requires spring.core;
exports com.lastfm.playlists.server.common.utils;
exports com.lastfm.playlists.server.common.model;
exports com.lastfm.playlists.server.common.model.lastfm;
}
Модуль моего сервиса pom.xml:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
server
com.lastfm.playlists
0.0.1-SNAPSHOT
4.0.0
com.lastfm.playlists.server
service
jar
service
com.lastfm.playlists.server
common
0.0.1-SNAPSHOT
Связанный модуль-info.java:
module service {
requires slf4j.api;
requires spring.beans;
requires spring.context;
requires spring.core;
requires spring.web;
requires lombok;
requires jackson.annotations;
requires common;
exports com.lastfm.playlists.server.service.api;
exports com.lastfm.playlists.server.service.api.lastfm.exception;
}
И мой API модуль pom.xml:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
server
com.lastfm.playlists
0.0.1-SNAPSHOT
4.0.0
com.lastfm.playlists.server
api
jar
api
com.lastfm.playlists.server
common
0.0.1-SNAPSHOT
com.lastfm.playlists.server
service
0.0.1-SNAPSHOT
Связанный модуль-info.java:
module api {
requires spring.boot;
requires spring.boot.autoconfigure;
requires spring.context;
requires spring.web;
requires spring.beans;
requires spring.data.commons;
requires java.validation;
requires slf4j.api;
requires common;
requires service;
requires spring.data.mongodb;
}
Подробнее здесь: https://stackoverflow.com/questions/494 ... nd-sibling
Spring Boot, модули Java 9 и проект нескольких модулей Maven: не удается найти родственный модуль ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение