I’m using s3 backed repositories as a document.
After updating oracle jdk to version 8u60, I met a following error below.
AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: D5BEFCA132123ECE)
As a result of investigating the problem, I guess that this problem is same as an issue and due to version of joda-time.
The report says we can use joda-time 2.8.1 with jdk 8u60, but I found Gradle uses an old version 2.7 of joda-time as a source, and Gradle doesn’t use a latest vesion of aws-java-sdk which AWS released.
As workarround, I downgraded jdk I’m using. However, I would like gradle to support latest jdk8.
Finally, I reported successful and failed stacktraces. I have executed them in a docker container, and I have masked private information.
- successful stacktrace
root@a46fec7aaeb5:~/app# ./gradlew --version
------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------
Build time: 2015-05-05 08:09:24 UTC
Build number: none
Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM: 1.8.0_51 (Oracle Corporation 25.51-b03)
OS: Linux 4.0.9-boot2docker amd64
root@a46fec7aaeb5:~/app# ./gradlew clean compileJava
...
:clean
:compileJava
Download s3://xxx//xxx/xxx/xxx-xxx.jar
BUILD SUCCESSFUL
- failed stacktrace
root@65ea2f079d3a:~/app# ./gradlew --version
------------------------------------------------------------
Gradle 2.4
------------------------------------------------------------
Build time: 2015-05-05 08:09:24 UTC
Build number: none
Revision: 5c9c3bc20ca1c281ac7972643f1e2d190f2c943c
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.4 compiled on April 29 2014
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Linux 4.0.9-boot2docker amd64
root@65ea2f079d3a:~/app# ./gradlew clean compileJava
...
:clean
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not download xxx.jar (xxx:xxx:xxx)
> Could not get resource 's3://xxx/xxx/xxx/xxx-xxx.jar'.
> AWS authentication requires a valid Date or x-amz-date header (Service: Amazon S3; Status Code: 403; Error Code: AccessDenied; Request ID: D5BEFCA132123ECE)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED