[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17693720#comment-17693720 ] Javier Neira Sanchez commented on MSHADE-345: - [~icshuo] hey, thanks for the hint to try to reroduce the issue. I followed it, you can check that version at [https://github.com/jneira/maven-shade-plugin/tree/SHADE-345_scala-package-relocation/src/it/projects/MSHADE-345_scala-package-relocation/src/main/scala] The scala app looks like: ``` import org.apache.logging.log4j.scala.Logger; import org.apache.logging.log4j.scala.Logging; object MyApp extends App with Logging { println("Logger FQCN: " + Logger.FQCN) logger.info("Test Logging") } ``` Executing the app shows ``` Logger FQCN: relocated.scala.Logger$ ``` Which still seems to be correct And, well, the bytecode generated for relocated classes also looks good, for example: ``` public void delayedInit(relocated.scala.Function0 Package relocation appears not to work with Scala > - > > Key: MSHADE-345 > URL: https://issues.apache.org/jira/browse/MSHADE-345 > Project: Maven Shade Plugin > Issue Type: Bug >Reporter: Graham Pople >Priority: Major > Attachments: image (4).png > > > (Apologies if this is a known issue, I searched but couldn't find it.) > I have a small pom.xml that's simply pulling in two dependent libraries from > Maven, and shading them: > {code:java} > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > com.couchbase.client > scala-deps > 1.1.1-SNAPSHOT > jar > Couchbase Scala Dependencies > Shadowing dependencies for Scala prokect > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-core_2.12 > 1.0.0 > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-macros_2.12 > 1.0.0 > > > > > > org.apache.maven.plugins > maven-shade-plugin > 3.2.1 > > > > com.github.plokhotnyuk > > com.couchbase.client.scala.deps.plokhotnyuk > > > true > true > true > > > > package > > shade > > > > > > > {code} > From this I expect to get an uber-jar containing those dependencies, with > classfiles inside > com/couchbase/client/scala/deps/plokhotnyuk/jsoniter_scala/..., and with > those files starting "package com.couchbase.client.scala.deps.plokhotnyuk...". > However, while the files are moved to the correct file structure, the package > names aren't adjusted. Here's a screenshot from the sources jar: > !image (4).png! > > And my experiments with the binary jar itself seem to indicate that the same > issue exists at the bytecode level in the regular jar too, e.g. the > classfiles are in the right place but the package hasn't been changed. > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17693058#comment-17693058 ] Shuo Cheng commented on MSHADE-345: --- hi, [~jneira], The reason that you can not reproduce the issue is that you `Main` class is Java class. Try to write another example `ScalaMain.scala` , and write code containing `org.apache.logging.log4j.scala.Logger`, then run `mvn package`, you will find `org.apache.logging.log4j.scala.Logger` not be shaded in `ScalaMain.class`. > Package relocation appears not to work with Scala > - > > Key: MSHADE-345 > URL: https://issues.apache.org/jira/browse/MSHADE-345 > Project: Maven Shade Plugin > Issue Type: Bug >Reporter: Graham Pople >Priority: Major > Attachments: image (4).png > > > (Apologies if this is a known issue, I searched but couldn't find it.) > I have a small pom.xml that's simply pulling in two dependent libraries from > Maven, and shading them: > {code:java} > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > com.couchbase.client > scala-deps > 1.1.1-SNAPSHOT > jar > Couchbase Scala Dependencies > Shadowing dependencies for Scala prokect > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-core_2.12 > 1.0.0 > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-macros_2.12 > 1.0.0 > > > > > > org.apache.maven.plugins > maven-shade-plugin > 3.2.1 > > > > com.github.plokhotnyuk > > com.couchbase.client.scala.deps.plokhotnyuk > > > true > true > true > > > > package > > shade > > > > > > > {code} > From this I expect to get an uber-jar containing those dependencies, with > classfiles inside > com/couchbase/client/scala/deps/plokhotnyuk/jsoniter_scala/..., and with > those files starting "package com.couchbase.client.scala.deps.plokhotnyuk...". > However, while the files are moved to the correct file structure, the package > names aren't adjusted. Here's a screenshot from the sources jar: > !image (4).png! > > And my experiments with the binary jar itself seem to indicate that the same > issue exists at the bytecode level in the regular jar too, e.g. the > classfiles are in the right place but the package hasn't been changed. > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17684326#comment-17684326 ] Javier Neira Sanchez commented on MSHADE-345: - Hi! i am trying to reproduce the issue but i am not sure on how do it: I have this pom.xml: {color:#808080}<{color}{color:#569cd6}project{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}modelVersion{color}{color:#808080}>{color}{color:#d4d4d4}4.0.0{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}groupId{color}{color:#808080}>{color}{color:#d4d4d4}org.apache.maven.its.shade.rie{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}artifactId{color}{color:#808080}>{color}{color:#d4d4d4}test{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}version{color}{color:#808080}>{color}{color:#d4d4d4}1.0{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}packaging{color}{color:#808080}>{color}{color:#d4d4d4}jar{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}name{color}{color:#808080}>{color}{color:#d4d4d4}MSHADE-345{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}description{color}{color:#808080}>{color} {color:#d4d4d4} Test handling scala package relocation.{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}dependencies{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}dependency{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}groupId{color}{color:#808080}>{color}{color:#d4d4d4}org.apache.logging.log4j{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}artifactId{color}{color:#808080}>{color}{color:#d4d4d4}log4j-api-scala_2.11{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}version{color}{color:#808080}>{color}{color:#d4d4d4}12.0{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}dependency{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}build{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}plugins{color}{color:#808080}>{color} {color:#808080}{color:#808080} {color}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}groupId{color}{color:#808080}>{color}{color:#d4d4d4}org.apache.maven.plugins{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}artifactId{color}{color:#808080}>{color}{color:#d4d4d4}maven-jar-plugin{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}configuration{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}archive{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}manifest{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}mainClass{color}{color:#808080}>{color}{color:#d4d4d4}Main{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}plugin{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}groupId{color}{color:#808080}>{color}{color:#d4d4d4}org.apache.maven.plugins{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}artifactId{color}{color:#808080}>{color}{color:#d4d4d4}maven-shade-plugin{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}version{color}{color:#808080}>{color}{color:#d4d4d4}3.2.4{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}executions{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}execution{color}{color:#808080}>{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}id{color}{color:#808080}>{color}{color:#d4d4d4}attach-shade-211{color}{color:#808080}{color} {color:#d4d4d4} {color}{color:#808080}<{color}{color:#569cd6}phase{color}{color:#808080}>{color}{color:#d4d4d4}package{color}{color:#808080}{color} {c
[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17679173#comment-17679173 ] Javier Neira Sanchez commented on MSHADE-345: - Hi, sadly still no news about the issue, there is some plan or wip about it? thanks! > Package relocation appears not to work with Scala > - > > Key: MSHADE-345 > URL: https://issues.apache.org/jira/browse/MSHADE-345 > Project: Maven Shade Plugin > Issue Type: Bug >Reporter: Graham Pople >Priority: Major > Attachments: image (4).png > > > (Apologies if this is a known issue, I searched but couldn't find it.) > I have a small pom.xml that's simply pulling in two dependent libraries from > Maven, and shading them: > {code:java} > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > com.couchbase.client > scala-deps > 1.1.1-SNAPSHOT > jar > Couchbase Scala Dependencies > Shadowing dependencies for Scala prokect > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-core_2.12 > 1.0.0 > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-macros_2.12 > 1.0.0 > > > > > > org.apache.maven.plugins > maven-shade-plugin > 3.2.1 > > > > com.github.plokhotnyuk > > com.couchbase.client.scala.deps.plokhotnyuk > > > true > true > true > > > > package > > shade > > > > > > > {code} > From this I expect to get an uber-jar containing those dependencies, with > classfiles inside > com/couchbase/client/scala/deps/plokhotnyuk/jsoniter_scala/..., and with > those files starting "package com.couchbase.client.scala.deps.plokhotnyuk...". > However, while the files are moved to the correct file structure, the package > names aren't adjusted. Here's a screenshot from the sources jar: > !image (4).png! > > And my experiments with the binary jar itself seem to indicate that the same > issue exists at the bytecode level in the regular jar too, e.g. the > classfiles are in the right place but the package hasn't been changed. > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17601973#comment-17601973 ] Aniket Pradhan commented on MSHADE-345: --- We are still facing the same issue, almost two years after this bug was reported. Bumping this ticket for more visibility. > Package relocation appears not to work with Scala > - > > Key: MSHADE-345 > URL: https://issues.apache.org/jira/browse/MSHADE-345 > Project: Maven Shade Plugin > Issue Type: Bug >Reporter: Graham Pople >Priority: Major > Attachments: image (4).png > > > (Apologies if this is a known issue, I searched but couldn't find it.) > I have a small pom.xml that's simply pulling in two dependent libraries from > Maven, and shading them: > {code:java} > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > com.couchbase.client > scala-deps > 1.1.1-SNAPSHOT > jar > Couchbase Scala Dependencies > Shadowing dependencies for Scala prokect > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-core_2.12 > 1.0.0 > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-macros_2.12 > 1.0.0 > > > > > > org.apache.maven.plugins > maven-shade-plugin > 3.2.1 > > > > com.github.plokhotnyuk > > com.couchbase.client.scala.deps.plokhotnyuk > > > true > true > true > > > > package > > shade > > > > > > > {code} > From this I expect to get an uber-jar containing those dependencies, with > classfiles inside > com/couchbase/client/scala/deps/plokhotnyuk/jsoniter_scala/..., and with > those files starting "package com.couchbase.client.scala.deps.plokhotnyuk...". > However, while the files are moved to the correct file structure, the package > names aren't adjusted. Here's a screenshot from the sources jar: > !image (4).png! > > And my experiments with the binary jar itself seem to indicate that the same > issue exists at the bytecode level in the regular jar too, e.g. the > classfiles are in the right place but the package hasn't been changed. > -- This message was sent by Atlassian Jira (v8.20.10#820010)
[jira] [Commented] (MSHADE-345) Package relocation appears not to work with Scala
[ https://issues.apache.org/jira/browse/MSHADE-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17226540#comment-17226540 ] zhangminglei commented on MSHADE-345: - I encounter this same issue. I would like to think we should add relocation for scala in shade. > Package relocation appears not to work with Scala > - > > Key: MSHADE-345 > URL: https://issues.apache.org/jira/browse/MSHADE-345 > Project: Maven Shade Plugin > Issue Type: Bug >Reporter: Graham Pople >Priority: Major > Attachments: image (4).png > > > (Apologies if this is a known issue, I searched but couldn't find it.) > I have a small pom.xml that's simply pulling in two dependent libraries from > Maven, and shading them: > {code:java} > > http://maven.apache.org/POM/4.0.0"; > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd";> > 4.0.0 > com.couchbase.client > scala-deps > 1.1.1-SNAPSHOT > jar > Couchbase Scala Dependencies > Shadowing dependencies for Scala prokect > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-core_2.12 > 1.0.0 > > > com.github.plokhotnyuk.jsoniter-scala > jsoniter-scala-macros_2.12 > 1.0.0 > > > > > > org.apache.maven.plugins > maven-shade-plugin > 3.2.1 > > > > com.github.plokhotnyuk > > com.couchbase.client.scala.deps.plokhotnyuk > > > true > true > true > > > > package > > shade > > > > > > > {code} > From this I expect to get an uber-jar containing those dependencies, with > classfiles inside > com/couchbase/client/scala/deps/plokhotnyuk/jsoniter_scala/..., and with > those files starting "package com.couchbase.client.scala.deps.plokhotnyuk...". > However, while the files are moved to the correct file structure, the package > names aren't adjusted. Here's a screenshot from the sources jar: > !image (4).png! > > And my experiments with the binary jar itself seem to indicate that the same > issue exists at the bytecode level in the regular jar too, e.g. the > classfiles are in the right place but the package hasn't been changed. > -- This message was sent by Atlassian Jira (v8.3.4#803005)