У меня есть многомодульная сборка Maven, в которой один модуль затеняет библиотеку, а другой модуль использует общую библиотеку.
Если я запускаю mvn test
, это приводит к package com.example.shaded.javax.el7 does not exist
.
Если я запускаю mvn package test
, компиляция и тесты проходят.
Поэтому мне бы хотелось, чтобы затененный модуль не просто компилировался, но и был затенен (упакован), выполняя maven-shade-plugin:3.2.1:shade
дозависимый модуль компилируется.
Возможно ли ввести такую целевую зависимость в maven в pom.xml?
Привязка плагина затенения к другим фазам, отличным от пакета, выдает это сообщение об ошибке:
[ERROR] The project main artifact does not exist. This could have the following
[ERROR] reasons:
[ERROR] - You have invoked the goal directly from the command line. This is not
[ERROR] supported. Please add the goal to the default lifecycle via an
[ERROR] <execution> element in your POM and use "mvn package" to have it run.
[ERROR] - You have bound the goal to a lifecycle phase before "package". Please
[ERROR] remove this binding from your POM such that the goal will be run in
[ERROR] the proper phase.