[
https://issues.apache.org/jira/browse/BEAM-1840?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15951050#comment-15951050
]
Aviem Zur commented on BEAM-1840:
---------------------------------
The relocation rules are based on the artifact ids, and not the package names.
{{code}}
<shadedPattern>
org.apache.${renderedArtifactId}.repackaged.com.google.common
</shadedPattern>
{{code}}
The way we calculate {{renderedArtifactId}} is replacing non-alphanumeric
characters in the artifact id with {{.}}
{{code}}
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>render-artifact-id</id>
<goals>
<goal>regex-properties</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<regexPropertySettings>
<regexPropertySetting>
<name>renderedArtifactId</name>
<regex>[^A-Za-z0-9]</regex>
<replacement>.</replacement>
<value>${project.artifactId}</value>
<failIfNoMatch>false</failIfNoMatch>
</regexPropertySetting>
</regexPropertySettings>
</configuration>
</execution>
</executions>
</plugin>
{{code}}
If we want the relocated classes to be in the {{sdk}} package instead of
{{sdks}} package what needs to be done is add another replacement on
{{renderedArtifactId}} which will replace {{sdks}} with {{sdk}}.
> shaded classes are not getting into the proper package
> ------------------------------------------------------
>
> Key: BEAM-1840
> URL: https://issues.apache.org/jira/browse/BEAM-1840
> Project: Beam
> Issue Type: Improvement
> Components: build-system
> Reporter: Ismaël Mejía
> Assignee: Ismaël Mejía
> Priority: Trivial
>
> The current shade configuration relocates classes into packages based in the
> artifact name, however this is inconsistent with the package nams because the
> beam artifact ids follow the directory structure beam-sdks-java-io-* but the
> package structure is beam/sdk/java/io so there is an extra 's' that creates a
> different package.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)