[
https://issues.apache.org/jira/browse/MNG-7467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529256#comment-17529256
]
Michael Osipov commented on MNG-7467:
-------------------------------------
I can confirm this:
{noformat}
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ service ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e.
build is platform dependent!
[INFO] Compiling 1 source file to
/tmp/maven3-relocate-transitive-dependency/service/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[3,30]
package com.google.common.base does not exist
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[4,30]
package com.google.common.base does not exist
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[8,38]
cannot find symbol
symbol: variable Strings
location: class org.example.service.App
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[8,9]
cannot find symbol
symbol: variable Preconditions
location: class org.example.service.App
[INFO] 4 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for maven3-relocate-transitive-dependency 1.0-SNAPSHOT:
[INFO]
[INFO] maven3-relocate-transitive-dependency .............. SUCCESS [ 1.190 s]
[INFO] api ................................................ SUCCESS [ 3.855 s]
[INFO] service ............................................ FAILURE [ 0.503 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.720 s
[INFO] Finished at: 2022-04-28T09:40:15+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on
project service: Compilation failure: Compilation failure:
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[3,30]
package com.google.common.base does not exist
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[4,30]
package com.google.common.base does not exist
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[8,38]
cannot find symbol
[ERROR] symbol: variable Strings
[ERROR] location: class org.example.service.App
[ERROR]
/tmp/maven3-relocate-transitive-dependency/service/src/main/java/org/example/service/App.java:[8,9]
cannot find symbol
[ERROR] symbol: variable Preconditions
[ERROR] location: class org.example.service.App
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
{noformat}
> Compilation failure with relocated transitive dependency
> --------------------------------------------------------
>
> Key: MNG-7467
> URL: https://issues.apache.org/jira/browse/MNG-7467
> Project: Maven
> Issue Type: Bug
> Components: Core
> Affects Versions: 3.8.5
> Environment: Ubuntu and/or MacOS
> Reporter: Jiajing Lu
> Priority: Major
>
> The latest version maven 3.8.5 failed to compile modules with relocated
> transitive dependency.
> I've created a minimal repo to reproduce the issue,
> [https://github.com/lujiajing1126/maven3-relocate-transitive-dependency]
>
> The "API" submodule declares a `google/guava` dependency and relocates it
> with shade plugin, while the "Service" module uses "API" as a dependency.
> The CI shows the code can be compiled with maven <=3.8.4, including
> * 3.8.4
> * 3.8.1
> * 3.6.3
> * 3.5.4
> But it failed the maven-3.8.5 case.
> I'm not sure whether it is a regression or a new feature/bugfix.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)