[
https://issues.apache.org/jira/browse/MSHADE-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jin Kwon updated MSHADE-403:
----------------------------
Description:
For following dependencies,
{code:xml}
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-reactivestreams</artifactId>
<version>${version.org.mongodb}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>${version.org.mongodb}</version>
<scope>compile</scope>
</dependency>
{code}
I excluded them
{code:xml}
<artifactSet>
<excludes>
<exclude>org.mongodb:*</exclude>
</excludes>
</artifactSet>
{code}
and relocate for other artifacts.
{code:xml}
<relocation>
<pattern>com</pattern>
<shadedPattern>com.mycompany.relocated.com</shadedPattern>
<excludes>
<exclude>com.mycompany.**</exclude>
</excludes>
</relocation>
{code}
Those excluded artifacts are not contained in the shaded artifact as expected.
But I see wrongly modified imports in one of main classes.
{code:java}
import com.mycompany.relocated.com.mongodb.MongoClientSettings;
import com.mycompany.relocated.com.mongodb.client.MongoClient;
import com.mycompany.relocated.com.mongodb.client.MongoClients;
{code}
Should I relocate for each {{com.whatever}} packages from non-excluded
artifacts?
was:
For following dependencies,
{code:xml}
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-reactivestreams</artifactId>
<version>${version.org.mongodb}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>${version.org.mongodb}</version>
<scope>compile</scope>
</dependency>
{code}
I excluded them
{code:xml}
<artifactSet>
<excludes>
<exclude>org.mongodb:*</exclude>
</excludes>
</artifactSet>
{code}
and relocate for other artifacts.
{code:xml}
<relocation>
<pattern>com</pattern>
<shadedPattern>com.mycompany.relocated.com</shadedPattern>
<excludes>
<exclude>com.mycompany.**</exclude>
</excludes>
</relocation>
{code}
Those excluded artifacts are not contained in the shaded artifact as expected.
But I see wrongly modified imports in one of main classes.
{code:java}
import com.mycompany.relocated.com.mongodb.MongoClientSettings;
import com.mycompany.relocated.com.mongodb.client.MongoClient;
import com.mycompany.relocated.com.mongodb.client.MongoClients;
{code}
> Imports are wrongly modified even for excluded artifacts
> --------------------------------------------------------
>
> Key: MSHADE-403
> URL: https://issues.apache.org/jira/browse/MSHADE-403
> Project: Maven Shade Plugin
> Issue Type: Bug
> Affects Versions: 3.2.4
> Reporter: Jin Kwon
> Priority: Major
>
> For following dependencies,
> {code:xml}
> <dependency>
> <groupId>org.mongodb</groupId>
> <artifactId>mongodb-driver-reactivestreams</artifactId>
> <version>${version.org.mongodb}</version>
> <scope>compile</scope>
> </dependency>
> <dependency>
> <groupId>org.mongodb</groupId>
> <artifactId>mongodb-driver-sync</artifactId>
> <version>${version.org.mongodb}</version>
> <scope>compile</scope>
> </dependency>
> {code}
> I excluded them
> {code:xml}
> <artifactSet>
> <excludes>
> <exclude>org.mongodb:*</exclude>
> </excludes>
> </artifactSet>
> {code}
> and relocate for other artifacts.
> {code:xml}
> <relocation>
> <pattern>com</pattern>
> <shadedPattern>com.mycompany.relocated.com</shadedPattern>
> <excludes>
> <exclude>com.mycompany.**</exclude>
> </excludes>
> </relocation>
> {code}
> Those excluded artifacts are not contained in the shaded artifact as expected.
> But I see wrongly modified imports in one of main classes.
> {code:java}
> import com.mycompany.relocated.com.mongodb.MongoClientSettings;
> import com.mycompany.relocated.com.mongodb.client.MongoClient;
> import com.mycompany.relocated.com.mongodb.client.MongoClients;
> {code}
> Should I relocate for each {{com.whatever}} packages from non-excluded
> artifacts?
--
This message was sent by Atlassian Jira
(v8.3.4#803005)