[ 
https://issues.apache.org/jira/browse/MSHADE-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17350793#comment-17350793
 ] 

Alexander Kriegisch commented on MSHADE-197:
--------------------------------------------

I also do source shading sometimes and improved something in MSHADE-252, which 
was just merged yesterday. I stumbled across this one and whated to verify if 
it is still an issue with Shade 3.2.4, both before and after my changes.

Before I look into this in more detail, please explain what you are trying to 
achieve:
 * It looks as if you try to build (part of) the original AWS Java SDK from 
scratch, trying to compile relocated sources. Why would you do that? Are you 
one of the committers in that project?
 * Normally, you would depend on the AWS SDK binaries in your own project and 
shade those. The sources are not meant to be recompiled (except for maybe being 
used in order to create relocated Javadocs). Source shading is meant to help 
you attach a source JAR to your uber JAR using relocated binaries, so as to be 
able to navigate to sources fitting the binaries in your IDE or so.

So before explaining *how* you want to do something, better explain first 
*what* you want to achieve. Otherwise, your question suffers from the [XY 
problem|https://meta.stackexchange.com/a/66378/309898].

For reference, the mailing list message containing the GitHub link is [this 
one|https://mail-archives.apache.org/mod_mbox/maven-users/201506.mbox/%[email protected]%3E],
 the GitHub repository clone of AWS Java SDK is on [this 
branch|https://github.com/tribloom/aws-sdk-java/tree/1.10.2]. You should have 
included the links directly in your question, not let people first jump to the 
head of the mailing list thread, having to sift through all messages in order 
to finally find the link.

> Shade fails to relocate packages for all classes
> ------------------------------------------------
>
>                 Key: MSHADE-197
>                 URL: https://issues.apache.org/jira/browse/MSHADE-197
>             Project: Maven Shade Plugin
>          Issue Type: Bug
>    Affects Versions: 2.4
>         Environment: Windows 7, Maven 3.0.5
>            Reporter: Michael McCarthy
>            Priority: Major
>
> I attempted to relocate the {{org.apache.http.*}} packages using the shade 
> plugin on the AWS Java SDK. This fails to update the location for at least 
> one class, {{com.amazonaws.services.s3.model.S3ObjectInputStream}}. I 
> manually updated the source code to use the shaded location and it compiled 
> without issue:
> {code}
> import org.shaded.http.client.HttpClient;
> import org.shaded.http.client.methods.HttpRequestBase;
> import org.shaded.http.conn.EofSensorInputStream;
> {code}
> Before making the above change, the error I get is:
> {noformat}
> [ERROR] 
> \dev\CSJ\aws\temp\aws-sdk-java\aws-java-sdk-s3\src\main\java\com\amazonaws\services\s3\internal\S3ObjectResponseHandler.java:[54,26]
> error: no suitable constructor found for 
> S3ObjectInputStream(InputStream,org.shaded.http.client.methods.HttpRequestBase)
> {noformat}
> The configuration I used in pom.xml was:
> {code:xml}
> <plugin>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-shade-plugin</artifactId>
>     <version>2.4</version>
>     <configuration>
>        <artifactSet>
>           <includes>
>              <include>com.amazonaws:*</include>
> <include>org.apache.httpcomponents:*</include>
>           </includes>
>        </artifactSet>
>        <relocations>
>           <relocation>
>              <pattern>org.apache.http</pattern>
> <shadedPattern>org.shaded.http</shadedPattern>
>           </relocation>
>        </relocations>
>     </configuration>
>     <executions>
>        <execution>
>           <phase>package</phase>
>           <goals>
>              <goal>shade</goal>
>           </goals>
>        </execution>
>     </executions>
> </plugin>
> {code}
> See 
> http://mail-archives.apache.org/mod_mbox/maven-users/201506.mbox/%3C558BE1C5.2020400%40tribloom.com%3E
>  for more details. This thread has instructions on how to reproduce as well 
> as links to a Github project with the changes already made and the error easy 
> to reproduce.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to