Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes 270 - Exclude deps from modules that depend on shaded jar #285

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project aims to adhere to [Semantic Versioning](http://semver.org/).
- Object content verification of standard PUT requests was being
skipped if the server [omitted the computed MD5](https://github.com/joyent/java-manta/issues/298)
from the response.
- [`mvn integration-test site` fails enforce-ban-duplicate-classes](https://github.com/joyent/java-manta/issues/270)

## [3.1.5] - 2017-07-28
### Fixed
Expand Down
55 changes: 55 additions & 0 deletions java-manta-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,61 @@
<groupId>com.joyent.manta</groupId>
<artifactId>java-manta-client</artifactId>
<version>3.1.7-SNAPSHOT</version>

<!-- If you add a dependency to java-manta-client that is shaded,
you will have to add it as an exclusion below because the
Maven enforcer plugin is simpleminded and it will detect
the shaded class and the dependency jar as conflicting. -->
<exclusions>
<exclusion>
<groupId>com.joyent.http-signature</groupId>
<artifactId>apache-http-client-signature</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.jnagmp</groupId>
<artifactId>bouncycastle-rsa</artifactId>
</exclusion>
<exclusion>
<groupId>com.twmacinta</groupId>
<artifactId>fast-md5</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
68 changes: 26 additions & 42 deletions java-manta-client-kryo-serialization/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,50 +20,16 @@
<groupId>com.joyent.manta</groupId>
<artifactId>java-manta-client</artifactId>
<version>3.1.7-SNAPSHOT</version>

<!-- If you add a dependency to java-manta-client that is shaded and
not relocated, you will have to add it as an exclusion below
because the Maven enforcer plugin is simpleminded and it will
detect the shaded class and the dependency jar as conflicting.
-->
<exclusions>
<exclusion>
<groupId>com.joyent.http-signature</groupId>
<artifactId>apache-http-client-signature</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</exclusion>
<exclusion>
<groupId>com.squareup.jnagmp</groupId>
<artifactId>bouncycastle-rsa</artifactId>
<groupId>com.twmacinta</groupId>
<artifactId>fast-md5</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down Expand Up @@ -120,6 +86,24 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.objenesis</groupId>
<artifactId>objenesis</artifactId>
<version>${dependency.objenesis.version}</version>
<scope>compile</scope>
</dependency>

<!-- Fast-md5 is added in the provided scope because it is shaded and
not relocated. We don't want it to be transitively passed on as a
dependency, so it is used in the runtime scope.
-->
<dependency>
<groupId>com.twmacinta</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change <groupId>com.twmacinta</groupId> to <groupId>com.joyent.util</groupId> here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Please commit that change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, PR #285 hasn't effectively solved the issue and it requires more work.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new branch fixes-270 has been created in my forked repository for proactively tracking this issue.

<artifactId>fast-md5</artifactId>
<version>${dependency.fast-md5.version}</version>
<scope>provided</scope>
</dependency>

<!-- These dependencies are declared at the module level because we can not
inherit exclusions from the parent. -->
<dependency>
Expand Down
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<maven-dependency-plugin.version>2.10</maven-dependency-plugin.version>
<maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
<maven-enforcer-plugin.version>1.4.1</maven-enforcer-plugin.version>
<maven-extra-enforcer-rules.version>1.0-beta-5</maven-extra-enforcer-rules.version>
<maven-extra-enforcer-rules.version>1.0-beta-6</maven-extra-enforcer-rules.version>
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-install-plugin.version>2.5.2</maven-install-plugin.version>
<maven-jar-plugin.version>3.0.2</maven-jar-plugin.version>
Expand Down Expand Up @@ -351,6 +351,20 @@
<rules>
<banDuplicateClasses>
<findAllDuplicates>true</findAllDuplicates>
<!-- Maven enforcer erroneously reports that the below
classes are duplicated in the following jars:

com.joyent.manta:java-manta-client:jar:3.1.4-SNAPSHOT:compile
com.twmacinta:fast-md5:jar:2.7.1:compile

The fast-md5 jar will be present during the test phase, but
it will not be part of the final artifact.
-->
<ignoreClasses>
<ignoreClass>com.twmacinta.util.MD5State</ignoreClass>
<ignoreClass>com.twmacinta.util.MD5InputStream</ignoreClass>
<ignoreClass>com.twmacinta.util.MD5</ignoreClass>
</ignoreClasses>
</banDuplicateClasses>
</rules>
<fail>true</fail>
Expand Down