-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update dependencies and shade cassandra-all usage. Astyanax is deprec…
…ated but still used by a lot of projects and Astyanax's very old dependencies have been making it difficult to migrate projects from Astyanax to the DataStax driver. The migration can be especially difficult for projects that need Astyanax and DataStax drivers to exist for some time (e.g. an app that wants to migrate its own Astyanax dependency to DataStax driver but still has other transitive dependencies to Astyanax). * Shaded cassandra-all to avoid dependency incompatibilities with newer versions of cassandra-unit/CassandraDaemon/EmbeddedCassandra for unit/integration testing. Relocates astyanax-cassandra's "org.apache.cassandra" dependencies to "com.netflix.astyanax.org.apache.cassandra." * Updated gradle wrapper to 4.1 * Updated all explicit dependencies to newer compatible versions. * Tested with Guava versions 19-25. * Eliminated/refactored some dependency declarations to reflect true dependencies and minimize transitive dependencies forced on Astyanax users. * Moved dependencies not actually used by src/main to "testCompile" to keep them out of user's transitive dependencies. * Added missing license headers. * Updated readme to more explicitly suggest Astyanax users migrate to DataStax driver. * Note that with shading cassandra-all, currently IntelliJ will incorrectly render "com.netflix.astyanax.org.apache.cassandra." as unfound. This is a known IntelliJ bug. Astyanax still builds perfectly fine via Gradle.
- Loading branch information
Showing
76 changed files
with
990 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* Shaded version of cassandra-all for the few classes used by astyanax-cassandra. Shading frees projects to select | ||
* arbitrary versions of cassandra-unit for unit/integration testing against newer versions of Cassandra. | ||
* Hides Astyanax's dependency on cassandra-all by refactoring "org.apache.cassandra" classes to | ||
* "com.netflix.astyanax.shaded.org.apache.cassandra". | ||
*/ | ||
|
||
plugins { | ||
id 'com.github.johnrengelman.plugin-shadow' version '2.0.3' | ||
id 'java' | ||
} | ||
|
||
print "Shading cassandra-all for cassandraVersion=${cassandraVersion}\n" | ||
|
||
dependencies { | ||
compile ("org.apache.cassandra:cassandra-all:$cassandraVersion") { | ||
// Exclude all those heavy transitive dependencies because Astyanax doesn't need them | ||
transitive = false | ||
} | ||
} | ||
|
||
shadowJar { | ||
// Don't append default "-all" to end of shaded jar name. | ||
classifier = '' | ||
|
||
// Add only the shaded cassandra-all classes | ||
dependencies { | ||
include( | ||
dependency('org.apache.cassandra:cassandra-all::.*') | ||
) | ||
} | ||
|
||
// Shaded/rename cassandra-all class packages | ||
relocate("org.apache.cassandra", "com.netflix.astyanax.shaded.org.apache.cassandra") | ||
} | ||
|
||
tasks.build.dependsOn(shadowJar) | ||
|
||
// Create only the shadow jar containing the shaded classes | ||
tasks.jar.setEnabled(false) | ||
tasks.jar.dependsOn(tasks.shadowJar) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
apply plugin: 'osgi' | ||
|
||
/** | ||
* Cassandra-specific features shared by astyanax-thrift and astyanax-cql. | ||
*/ | ||
dependencies { | ||
compile project(':astyanax-core') | ||
compile ("org.apache.cassandra:cassandra-all:$cassandraVersion") { | ||
force = true | ||
transitive = false | ||
} | ||
compile project(':astyanax-core') | ||
|
||
// Shaded version of cassandra-all for the few simple classes Astyanax actually uses. | ||
// Also excludes cassandra-all's transitive dependencies. | ||
compile project(path: ':astyanax-cassandra-all-shaded', configuration: 'shadow') | ||
|
||
compile "org.xerial.snappy:snappy-java:$snappyVersion" | ||
compile "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion" | ||
compile "org.apache.cassandra:cassandra-thrift:$cassandraThriftVersion" | ||
compile "org.apache.servicemix.bundles:org.apache.servicemix.bundles.commons-csv:$commonsCsvVersion" | ||
compile "org.codehaus.jettison:jettison:$jettisonVersion" | ||
compile "commons-codec:commons-codec:$commonsCodecVersion" | ||
compile "org.slf4j:slf4j-api:$slf4jVersion" | ||
testCompile "junit:junit:$junitVersion" | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.