Skip to content

Fix Java 11 build #1139

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

Merged
merged 4 commits into from
Mar 19, 2019
Merged
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"category": "Netty NIO Http Client",
"type": "bugfix",
"description": "Fix failed test NettyNioAsyncHttpClientSpiVerificationTest when running with JDK11. See [#1038](https://github.com/aws/aws-sdk-java-v2/issues/1038)"
}
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: java
jdk:
- oraclejdk8
- openjdk11
sudo: true
dist: precise
install: /bin/true
Expand Down
1 change: 1 addition & 0 deletions aws-sdk-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
Amazon AutoScaling, etc).
</description>
<url>https://aws.amazon.com/sdkforjava</url>

<dependencies>
<dependency>
<artifactId>pinpoint</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,14 @@
<Bug pattern="BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" />
</Match>

<!-- https://github.com/spotbugs/spotbugs/issues/600 -->
<Match>
<Or>
<Class name="software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory"/>
<Class name="software.amazon.awssdk.protocols.json.internal.dom.JsonDomParser"/>
<Class name="software.amazon.awssdk.testutils.service.AwsIntegrationTestBase"/>
<Class name="software.amazon.awssdk.protocol.asserts.marshalling.XmlAsserts" />
</Or>
<Bug pattern="RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE"/>
</Match>
</FindBugsFilter>
151 changes: 77 additions & 74 deletions bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,81 +58,84 @@
</dependencies>

<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>software.amazon.awssdk:aws-sdk-java</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<artifactSet>
<includes>
<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>
</relocation>
<relocation>
<pattern>com.typesafe</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.com.typesafe</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.org.slf4j</shadedPattern>
</relocation>
</relocations>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
</dependencyReducedPomLocation>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<groupId>org.apache.maven.plugins</groupId>
<configuration>
<ignoredUnusedDeclaredDependencies>
<ignoredUnusedDeclaredDependency>software.amazon.awssdk:aws-sdk-java</ignoredUnusedDeclaredDependency>
</ignoredUnusedDeclaredDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<artifactSet>
<includes>
<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>
</relocation>
<relocation>
<pattern>com.typesafe</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.com.typesafe</shadedPattern>
</relocation>
<relocation>
<pattern>org.slf4j</pattern>
<shadedPattern>software.amazon.awssdk.thirdparty.org.slf4j</shadedPattern>
</relocation>
</relocations>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml
</dependencyReducedPomLocation>
<promoteTransitiveDependencies>true</promoteTransitiveDependencies>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>publishing</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ private Stream<ExecutionInterceptor> createExecutionInterceptorFromResource(URL
}

private ExecutionInterceptor createExecutionInterceptor(String interceptorClassName) {
if (interceptorClassName == null) {
return null;
}

interceptorClassName = interceptorClassName.trim();
if (interceptorClassName.equals("")) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,10 @@ public static void tearDown() throws Exception {
client.close();
}

// CONNECTION_RESET_BY_PEER does not work on JDK 11. See https://github.com/tomakehurst/wiremock/issues/1009
@Test
public void signalsErrorViaOnErrorAndFuture() throws InterruptedException, ExecutionException, TimeoutException {
stubFor(any(urlEqualTo("/")).willReturn(aResponse().withFault(Fault.CONNECTION_RESET_BY_PEER)));
stubFor(any(urlEqualTo("/")).willReturn(aResponse().withFault(Fault.RANDOM_DATA_THEN_CLOSE)));

CompletableFuture<Boolean> errorSignaled = new CompletableFuture<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#

# Set up logging implementation
org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
org.eclipse.jetty.LEVEL=OFF
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#

log4j.rootLogger=ERROR, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

# Adjust to see more / less logging
#log4j.logger.com.amazonaws.ec2=DEBUG

# HttpClient 3 Wire Logging
#log4j.logger.httpclient.wire=DEBUG

# HttpClient 4 Wire Logging
# log4j.logger.org.apache.http.wire=INFO
# log4j.logger.org.apache.http=DEBUG
# log4j.logger.org.apache.http.wire=DEBUG
# log4j.logger.software.amazonaws.awssdk=DEBUG


2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<unitils.version>3.3</unitils.version>
<xmlunit.version>1.3</xmlunit.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spotbugs.version>3.1.9</spotbugs.version>
<spotbugs.version>3.1.11</spotbugs.version>
<netty-reactive-streams-http.version>2.0.0</netty-reactive-streams-http.version>
<freemarker.version>2.3.24-incubating</freemarker.version>
<javapoet.verion>1.11.1</javapoet.verion>
Expand Down