Skip to content

Commit

Permalink
Release preparation for removing Jackson as an external dependency (a…
Browse files Browse the repository at this point in the history
…ws#2598)

* Moved Jackson from being an external SDK dependency to an internal dependency.

Jackson-databind was removed from being a dependency (except in the code generator). Jackson-core and
Jackson-dataformat-cbor were moved to shaded dependencies. This was done because Jackson versions
are not 100% compatible between minor versions and keeping them up to date were problematic for SDK
customers.

Customers will see a change in artifact sizes. Customers which do not use Jackson-databind outside of
the SDK today will see a ~1 MB artifact size decrease. Customers which do use Jackson-databind outside
of the SDK will see a ~0.5 MB artifact size increase.

This change required breaking inter-module (protected) APIs, so it should not be released outside of an
SDK minor version bump. Customers will not be able to use older client versions with this version of
the core libraries.

Change summary:
1. Added 'jackson-core' and 'jackson-dataformat-cbor' which contain the SDK's shaded versions with the
   Jackson packages of the same names.
2. Removed 'aws-ion-protocol' module. This was not used by any public AWS services and can be re-added when
   service support is needed.
3. Added 'json-utils', a library for reading and parsing JSON.

* Version bump to 2.17.0
  • Loading branch information
millems authored Jul 16, 2021
1 parent 361afd8 commit 51cf791
Show file tree
Hide file tree
Showing 407 changed files with 2,488 additions and 5,269 deletions.
12 changes: 12 additions & 0 deletions .brazil.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"modules": {
"third-party-jackson-core": {
"artifactType": "JAR",
"includes": ["target/aws-sdk-java-third-party-jackson-core-*.jar"]
},
"third-party-jackson-dataformat-cbor": {
"artifactType": "JAR",
"includes": ["target/aws-sdk-java-third-party-jackson-dataformat-cbor-*.jar"]
}
}
}
6 changes: 6 additions & 0 deletions .changes/next-release/feature-AWSSDKforJavav2-9e94920.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"category": "AWS SDK for Java v2",
"contributor": "",
"type": "feature",
"description": "Moved Jackson from an external SDK dependency to an internal dependency: https://aws.amazon.com/blogs/developer/the-aws-sdk-for-java-2-17-removes-its-external-dependency-on-jackson/"
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
# Maven
target/

# JEnv
.java-version

# Shade
**/dependency-reduced-pom.xml

*.pyc
Expand Down
2 changes: 2 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ This software includes third party software subject to the following copyrights:
- PKCS#1 PEM encoded private key parsing and utility functions from oauth.googlecode.com - Copyright 1998-2010 AOL Inc.
- Apache Commons Lang - https://github.com/apache/commons-lang
- Netty Reactive Streams - https://github.com/playframework/netty-reactive-streams
- Jackson-core - https://github.com/FasterXML/jackson-core
- Jackson-dataformat-cbor - https://github.com/FasterXML/jackson-dataformats-binary

The licenses for these third party components are included in LICENSE.txt

Expand Down
4 changes: 2 additions & 2 deletions archetypes/archetype-app-quickstart/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -171,4 +171,4 @@
</plugins>
</build>

</project>
</project>
4 changes: 2 additions & 2 deletions archetypes/archetype-lambda/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetype-lambda</artifactId>
Expand Down Expand Up @@ -169,4 +169,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
4 changes: 2 additions & 2 deletions archetypes/archetype-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>archetypes</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -59,4 +59,4 @@
</plugins>
</build>

</project>
</project>
4 changes: 2 additions & 2 deletions archetypes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>archetypes</artifactId>
Expand All @@ -34,4 +34,4 @@
<description>
Maven Archetypes for applications using Java SDK 2.x
</description>
</project>
</project>
2 changes: 1 addition & 1 deletion aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>aws-sdk-java</artifactId>
Expand Down
7 changes: 1 addition & 6 deletions bom-internal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>aws-sdk-java-pom</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -84,11 +84,6 @@
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.ion</groupId>
<artifactId>ion-java</artifactId>
<version>${ion.java.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
Expand Down
22 changes: 16 additions & 6 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>bom</artifactId>
Expand Down Expand Up @@ -64,27 +64,37 @@
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>auth</artifactId>
<artifactId>json-utils</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-core</artifactId>
<artifactId>third-party-jackson-core</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>profiles</artifactId>
<artifactId>third-party-jackson-dataformat-cbor</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-cbor-protocol</artifactId>
<artifactId>auth</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-core</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>profiles</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-ion-protocol</artifactId>
<artifactId>aws-cbor-protocol</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
Expand Down
13 changes: 1 addition & 12 deletions bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<artifactId>bundle</artifactId>
<packaging>jar</packaging>
Expand Down Expand Up @@ -70,31 +70,20 @@
<include>com.fasterxml.jackson.jr:*</include>
<include>io.netty:*</include>
<include>com.typesafe.netty:*</include>
<include>com.fasterxml.jackson.core:*</include>
<include>com.fasterxml.jackson.dataformat:jackson-dataformat-cbor</include>
<include>org.apache.httpcomponents:*</include>
<include>org.reactivestreams:*</include>
<include>org.slf4j:*</include>
<include>commons-codec:commons-codec</include>
<include>software.amazon.ion:ion-java</include>
<include>software.amazon.awssdk:*</include>
<include>software.amazon:*</include>
<include>commons-logging:*</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>com.fasterxml.jackson</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.com.fasterxml.jackson</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.org.apache</shadedPattern>
</relocation>
<relocation>
<pattern>software.amazon.ion</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.ion</shadedPattern>
</relocation>
<relocation>
<pattern>io.netty</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.io.netty</shadedPattern>
Expand Down
Empty file added change
Empty file.
2 changes: 1 addition & 1 deletion codegen-lite-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-lite-maven-plugin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion codegen-lite/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<artifactId>codegen-lite</artifactId>
<name>AWS Java SDK :: Code Generator Lite</name>
Expand Down
2 changes: 1 addition & 1 deletion codegen-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>codegen-maven-plugin</artifactId>
Expand Down
15 changes: 9 additions & 6 deletions codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<parent>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-sdk-java-pom</artifactId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<artifactId>codegen</artifactId>
<name>AWS Java SDK :: Code Generator</name>
Expand Down Expand Up @@ -102,11 +102,6 @@
<artifactId>aws-cbor-protocol</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-ion-protocol</artifactId>
<version>${awsjavasdk.version}</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>aws-query-protocol</artifactId>
Expand Down Expand Up @@ -143,6 +138,14 @@
<groupId>com.fasterxml.jackson.jr</groupId>
<artifactId>jackson-jr-stree</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,17 +499,12 @@ public Metadata withJsonVersion(String jsonVersion) {
return this;
}

public boolean isIonProtocol() {
return protocol == Protocol.ION;
}

public boolean isCborProtocol() {
return protocol == Protocol.CBOR;
}

public boolean isJsonProtocol() {
return protocol == Protocol.CBOR ||
protocol == Protocol.ION ||
protocol == Protocol.AWS_JSON ||
protocol == Protocol.REST_JSON;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ public enum Protocol {
REST_JSON("rest-json"),
CBOR("cbor"),
QUERY("query"),
REST_XML("rest-xml"),
ION("ion");
REST_XML("rest-xml");

private String protocol;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ static ProtocolSpec getProtocolSpecs(PoetExtensions poetExtensions, Intermediate
case AWS_JSON:
case REST_JSON:
case CBOR:
case ION:
return new JsonProtocolSpec(poetExtensions, model);
default:
throw new RuntimeException("Unknown protocol: " + protocol.name());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.protocol.VoidSdkResponse;
import software.amazon.awssdk.protocols.cbor.AwsCborProtocolFactory;
import software.amazon.awssdk.protocols.ion.AwsIonProtocolFactory;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
Expand Down Expand Up @@ -119,8 +118,6 @@ private CodeBlock customErrorCodeFieldName() {
private Class<?> protocolFactoryClass() {
if (model.getMetadata().isCborProtocol()) {
return AwsCborProtocolFactory.class;
} else if (model.getMetadata().isIonProtocol()) {
return AwsIonProtocolFactory.class;
} else {
return AwsJsonProtocolFactory.class;
}
Expand Down Expand Up @@ -377,7 +374,6 @@ public Optional<MethodSpec> createErrorResponseHandler() {
private String protocolEnumName(software.amazon.awssdk.codegen.model.intermediate.Protocol protocol) {
switch (protocol) {
case CBOR:
case ION:
case AWS_JSON:
return AWS_JSON.name();
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ private MarshallerProtocolSpec getProtocolSpecs(software.amazon.awssdk.codegen.m
switch (protocol) {
case REST_JSON:
case CBOR:
case ION:
case AWS_JSON:
return getJsonMarshallerSpec();

Expand Down
2 changes: 1 addition & 1 deletion core/annotations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions core/arns/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<artifactId>core</artifactId>
<groupId>software.amazon.awssdk</groupId>
<version>2.16.105-SNAPSHOT</version>
<version>2.17.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down Expand Up @@ -74,4 +74,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Loading

0 comments on commit 51cf791

Please sign in to comment.