Почему Плагин компилятора Maven обрабатывает тестовый код иначе, чем производственный код? Есть ли способ заставить цель compiler:testCompile разрешать путь к модулю так же, как цель compiler:compile?
Подробнее:
Соответствующий фрагмент помпы:
Код: Выделить всё
io.swagger.parser.v3
swagger-parser
2.1.20
com.fasterxml.jackson.core
jackson-databind
2.17.1
com.fasterxml.jackson.core
jackson-annotations
2.17.1
com.fasterxml.jackson.dataformat
jackson-dataformat-yaml
2.17.1
org.junit.jupiter
junit-jupiter
5.9.0
test
org.assertj
assertj-core
3.25.3
test
org.apache.maven.plugins
maven-compiler-plugin
3.13.0
org.apache.maven.plugins
maven-surefire-plugin
3.5.0
Код: Выделить всё
module org.yonas.project {
exports services;
requires swagger.parser.core;
requires swagger.parser;
requires io.swagger.v3.oas.models;
requires com.fasterxml.jackson.annotation;
requires com.fasterxml.jackson.databind;
requires com.fasterxml.jackson.dataformat.yaml;
}
Код: Выделить всё
open module org.yonas.project.test {
exports testpackage;
requires org.yonas.project;
requires transitive org.junit.jupiter.api;
requires transitive org.junit.jupiter.engine;
requires java.net.http;
requires com.fasterxml.jackson.databind;
requires swagger.parser.core;
requires swagger.parser;
requires io.swagger.v3.oas.models;
requires org.assertj.core;
}
Код: Выделить всё
[DEBUG] Classpath:
[a lot of jars here, including transitive dependencies]
[DEBUG] Modulepath:
[a few jars here, only direct dependencies]
Код: Выделить всё
[DEBUG] Classpath:
[DEBUG] Modulepath:
[many jars here]
[...]
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.13.0:testCompile (default-testCompile) on project ...
failure: Compilation failure:
[ERROR] the unnamed module reads package com.github.fge.jackson from both jackson.coreutils.equivalence and jackson.coreutils
[ERROR] the unnamed module reads package io.swagger.parser from both swagger.compat.spec.parser and swagger.parser
[ERROR] ...
[...and 97 more errors concerning split packages]
Подробнее здесь: https://stackoverflow.com/questions/790 ... odule-path