From bc5dbf44e754066b29347c46b9f9d04ce15ddbbb Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 12:56:49 -0300 Subject: [PATCH 1/9] Adding handler to s3 maven artifacts --- 3rdparty/jvm/com/amazonaws/BUILD | 85 ++++ .../com/fasterxml/jackson/dataformat/BUILD | 15 + 3rdparty/jvm/commons_logging/BUILD | 13 + 3rdparty/jvm/joda_time/BUILD | 13 + 3rdparty/jvm/org/apache/httpcomponents/BUILD | 1 + 3rdparty/jvm/org/apache/ivy/BUILD | 13 + 3rdparty/jvm/software/amazon/ion/BUILD | 13 + 3rdparty/workspace.bzl | 37 +- WORKSPACE | 2 +- dependencies.yaml | 16 + .../com/github/johnynek/bazel_deps/BUILD | 31 ++ .../bazel_deps/CoursierResolver.scala | 13 +- .../johnynek/bazel_deps/S3Handler.scala | 8 + .../johnynek/bazel_deps/S3URLConnection.scala | 102 +++++ .../johnynek/bazel_deps/S3URLHandler.scala | 422 ++++++++++++++++++ 15 files changed, 773 insertions(+), 11 deletions(-) create mode 100644 3rdparty/jvm/com/amazonaws/BUILD create mode 100644 3rdparty/jvm/commons_logging/BUILD create mode 100644 3rdparty/jvm/joda_time/BUILD create mode 100644 3rdparty/jvm/org/apache/ivy/BUILD create mode 100644 3rdparty/jvm/software/amazon/ion/BUILD create mode 100644 src/scala/com/github/johnynek/bazel_deps/S3Handler.scala create mode 100644 src/scala/com/github/johnynek/bazel_deps/S3URLConnection.scala create mode 100644 src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala diff --git a/3rdparty/jvm/com/amazonaws/BUILD b/3rdparty/jvm/com/amazonaws/BUILD new file mode 100644 index 00000000..a49ed421 --- /dev/null +++ b/3rdparty/jvm/com/amazonaws/BUILD @@ -0,0 +1,85 @@ +load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "aws_java_sdk_core", + exports = [ + "//external:jar/com/amazonaws/aws_java_sdk_core" + ], + runtime_deps = [ + "//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind", + "//3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_cbor", + "//3rdparty/jvm/commons_logging:commons_logging", + "//3rdparty/jvm/joda_time:joda_time", + "//3rdparty/jvm/org/apache/httpcomponents:httpclient", + "//3rdparty/jvm/software/amazon/ion:ion_java" + ], + visibility = [ + "//visibility:public" + ] +) + + + +java_library( + name = "aws_java_sdk_kms", + exports = [ + "//external:jar/com/amazonaws/aws_java_sdk_kms" + ], + runtime_deps = [ + ":aws_java_sdk_core", + ":jmespath_java" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + + +java_library( + name = "aws_java_sdk_s3", + exports = [ + "//external:jar/com/amazonaws/aws_java_sdk_s3" + ], + runtime_deps = [ + ":aws_java_sdk_core", + ":aws_java_sdk_kms", + ":jmespath_java" + ], + visibility = [ + "//visibility:public" + ] +) + + + +java_library( + name = "aws_java_sdk_sts", + exports = [ + "//external:jar/com/amazonaws/aws_java_sdk_sts" + ], + runtime_deps = [ + ":aws_java_sdk_core", + ":jmespath_java" + ], + visibility = [ + "//visibility:public" + ] +) + + + +java_library( + name = "jmespath_java", + exports = [ + "//external:jar/com/amazonaws/jmespath_java" + ], + runtime_deps = [ + "//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + diff --git a/3rdparty/jvm/com/fasterxml/jackson/dataformat/BUILD b/3rdparty/jvm/com/fasterxml/jackson/dataformat/BUILD index 914a1cf4..03bbd065 100644 --- a/3rdparty/jvm/com/fasterxml/jackson/dataformat/BUILD +++ b/3rdparty/jvm/com/fasterxml/jackson/dataformat/BUILD @@ -1,5 +1,20 @@ load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "jackson_dataformat_cbor", + exports = [ + "//external:jar/com/fasterxml/jackson/dataformat/jackson_dataformat_cbor" + ], + runtime_deps = [ + "//3rdparty/jvm/com/fasterxml/jackson/core:jackson_core" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + + java_library( name = "jackson_dataformat_yaml", exports = [ diff --git a/3rdparty/jvm/commons_logging/BUILD b/3rdparty/jvm/commons_logging/BUILD new file mode 100644 index 00000000..be9f4cea --- /dev/null +++ b/3rdparty/jvm/commons_logging/BUILD @@ -0,0 +1,13 @@ +load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "commons_logging", + exports = [ + "//external:jar/commons_logging/commons_logging" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + diff --git a/3rdparty/jvm/joda_time/BUILD b/3rdparty/jvm/joda_time/BUILD new file mode 100644 index 00000000..cc7d1552 --- /dev/null +++ b/3rdparty/jvm/joda_time/BUILD @@ -0,0 +1,13 @@ +load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "joda_time", + exports = [ + "//external:jar/joda_time/joda_time" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + diff --git a/3rdparty/jvm/org/apache/httpcomponents/BUILD b/3rdparty/jvm/org/apache/httpcomponents/BUILD index dd60d439..169c5dfa 100644 --- a/3rdparty/jvm/org/apache/httpcomponents/BUILD +++ b/3rdparty/jvm/org/apache/httpcomponents/BUILD @@ -7,6 +7,7 @@ java_library( ], runtime_deps = [ "//3rdparty/jvm/commons_codec:commons_codec", + "//3rdparty/jvm/commons_logging:commons_logging", ":httpcore" ], visibility = [ diff --git a/3rdparty/jvm/org/apache/ivy/BUILD b/3rdparty/jvm/org/apache/ivy/BUILD new file mode 100644 index 00000000..70036aa1 --- /dev/null +++ b/3rdparty/jvm/org/apache/ivy/BUILD @@ -0,0 +1,13 @@ +load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "ivy", + exports = [ + "//external:jar/org/apache/ivy/ivy" + ], + visibility = [ + "//visibility:public" + ] +) + + diff --git a/3rdparty/jvm/software/amazon/ion/BUILD b/3rdparty/jvm/software/amazon/ion/BUILD new file mode 100644 index 00000000..34485f5a --- /dev/null +++ b/3rdparty/jvm/software/amazon/ion/BUILD @@ -0,0 +1,13 @@ +load("@io_bazel_rules_scala//scala:scala_import.bzl", "scala_import") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_library") +java_library( + name = "ion_java", + exports = [ + "//external:jar/software/amazon/ion/ion_java" + ], + visibility = [ + "//3rdparty/jvm:__subpackages__" + ] +) + + diff --git a/3rdparty/workspace.bzl b/3rdparty/workspace.bzl index 20c4afb3..da7c4565 100644 --- a/3rdparty/workspace.bzl +++ b/3rdparty/workspace.bzl @@ -68,22 +68,35 @@ def jar_artifact_callback(hash): def list_dependencies(): return [ + {"artifact": "com.amazonaws:aws-java-sdk-core:1.11.507", "lang": "java", "sha1": "872cc4abbaca4dcf45f9122a2e58d4081e9a82e6", "sha256": "c13a475f712195690f952c9a3423e9b37174af368aa73f508f6a98966ec63f33", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-core/1.11.507/aws-java-sdk-core-1.11.507.jar", "source": {"sha1": "8f0c68ec3587f0132e090f14ad5e2cef26c70d4e", "sha256": "01909ce3aed7e95dc0edd89da177b493ee13ae9ae566351841167427d8f006e2", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-core/1.11.507/aws-java-sdk-core-1.11.507-sources.jar"} , "name": "com_amazonaws_aws_java_sdk_core", "actual": "@com_amazonaws_aws_java_sdk_core//jar", "bind": "jar/com/amazonaws/aws_java_sdk_core"}, + {"artifact": "com.amazonaws:aws-java-sdk-kms:1.11.507", "lang": "java", "sha1": "a5726e36e8ea052c0cbe5c57b7ecc6afd0ceaf7e", "sha256": "c73dafcd2c5f47598c9de5194fbddfc3d20640f4adcf9a0c41b5c5252b64fd97", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-kms/1.11.507/aws-java-sdk-kms-1.11.507.jar", "source": {"sha1": "da511e4d4dfbe04f0f9c4f0579ddf897fc6817b6", "sha256": "184bd7104bfea54f9953e58b191a9d446ec0a8ae074fc1db7aa47598a5770f46", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-kms/1.11.507/aws-java-sdk-kms-1.11.507-sources.jar"} , "name": "com_amazonaws_aws_java_sdk_kms", "actual": "@com_amazonaws_aws_java_sdk_kms//jar", "bind": "jar/com/amazonaws/aws_java_sdk_kms"}, + {"artifact": "com.amazonaws:aws-java-sdk-s3:1.11.507", "lang": "java", "sha1": "e2370fbae868e20d285c49e2d44a83305e882b1c", "sha256": "51fa0beeecba0db19f749b50d83c3d6ebaa63a4c16cdc29d046451562b8b46df", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-s3/1.11.507/aws-java-sdk-s3-1.11.507.jar", "source": {"sha1": "d1460ae035720e73a06b14dfad2bc7f303524a44", "sha256": "932cf33ff76f9172b52528ee2dd8ac16a8189fd0fcb42d9ae16e159cf0352e07", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-s3/1.11.507/aws-java-sdk-s3-1.11.507-sources.jar"} , "name": "com_amazonaws_aws_java_sdk_s3", "actual": "@com_amazonaws_aws_java_sdk_s3//jar", "bind": "jar/com/amazonaws/aws_java_sdk_s3"}, + {"artifact": "com.amazonaws:aws-java-sdk-sts:1.11.507", "lang": "java", "sha1": "3a9987295a8cfc0f11f7a09e77a2c99569a4a799", "sha256": "022f63e6496b7d0bde5328ab72eeea17de8865c001b80dfccc254542dfe6259a", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.507/aws-java-sdk-sts-1.11.507.jar", "source": {"sha1": "4229877fa311b8f8a342d1adf1bfb3663b5c1f69", "sha256": "cf43e47822a44f3dfe9bd5d774cc806d65b1fb30535b4d8c6ca7bc91ffb29f99", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/aws-java-sdk-sts/1.11.507/aws-java-sdk-sts-1.11.507-sources.jar"} , "name": "com_amazonaws_aws_java_sdk_sts", "actual": "@com_amazonaws_aws_java_sdk_sts//jar", "bind": "jar/com/amazonaws/aws_java_sdk_sts"}, + {"artifact": "com.amazonaws:jmespath-java:1.11.507", "lang": "java", "sha1": "a301dde47b1eac08cf1c85580c3255ffa58a98bb", "sha256": "02ab5882b8b95167919579f7e1c5c7ea443acd4020dd659783ee226d2fefa90e", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/jmespath-java/1.11.507/jmespath-java-1.11.507.jar", "source": {"sha1": "e8d60c2e78d2c9c5e6c5f8b2cc1de2a0acfa7167", "sha256": "9ce71e29b29e1b82aad410f4e1507bf71b71ca8ebfe4567f4c1eea71af50a68d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/amazonaws/jmespath-java/1.11.507/jmespath-java-1.11.507-sources.jar"} , "name": "com_amazonaws_jmespath_java", "actual": "@com_amazonaws_jmespath_java//jar", "bind": "jar/com/amazonaws/jmespath_java"}, {"artifact": "com.chuusai:shapeless_2.11:2.3.3", "lang": "scala", "sha1": "ea34d4b6128b9090386945dcb952816bd9e87ce2", "sha256": "d1ed83b05994d26e5e993efc86127a98a98ca09d45a995cfad4d6f161e2295c4", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/chuusai/shapeless_2.11/2.3.3/shapeless_2.11-2.3.3.jar", "source": {"sha1": "bd557edb3735e1bc8b0bc5fc3e7559252837a5e2", "sha256": "b36ee80cc64da6bffd86c29984bcb92b8e51dee9d180cfff683378caff1a2092", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/chuusai/shapeless_2.11/2.3.3/shapeless_2.11-2.3.3-sources.jar"} , "name": "com_chuusai_shapeless_2_11", "actual": "@com_chuusai_shapeless_2_11//jar:file", "bind": "jar/com/chuusai/shapeless_2_11"}, - {"artifact": "com.fasterxml.jackson.core:jackson-annotations:2.5.0", "lang": "java", "sha1": "a2a55a3375bc1cef830ca426d68d2ea22961190e", "sha256": "0ca408c24202a7626ec8b861e99d85eca5e38b73311dd6dd12e3e9deecc3fe94", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.5.0/jackson-annotations-2.5.0.jar", "source": {"sha1": "88b177349b719fe0636b50889687b9ed036bfd89", "sha256": "c47c11c9de37bc10b8f80cf479efbbc1a1e3237bbe1d88bcd31bbe8961a0aa47", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.5.0/jackson-annotations-2.5.0-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_annotations", "actual": "@com_fasterxml_jackson_core_jackson_annotations//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_annotations"}, -# duplicates in com.fasterxml.jackson.core:jackson-core promoted to 2.5.5 -# - com.fasterxml.jackson.core:jackson-databind:2.5.5 wanted version 2.5.5 + {"artifact": "com.fasterxml.jackson.core:jackson-annotations:2.6.0", "lang": "java", "sha1": "a0990e2e812ac6639b6ce955c91b13228500476e", "sha256": "03348c047d981376cc444fc466cd80bda8d7eb0698dc6a99dd52c5aa15eff5ad", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0.jar", "source": {"sha1": "7bcb615d523d88acbc121c92aafeba8d37a83792", "sha256": "6795af01611c1c2b784fd3af376f5ea553871a2c9b57844b1579f177e06e7173", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.6.0/jackson-annotations-2.6.0-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_annotations", "actual": "@com_fasterxml_jackson_core_jackson_annotations//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_annotations"}, +# duplicates in com.fasterxml.jackson.core:jackson-core promoted to 2.6.7 +# - com.fasterxml.jackson.core:jackson-databind:2.6.7.2 wanted version 2.6.7 +# - com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7 wanted version 2.6.7 # - com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.3 wanted version 2.5.3 # - io.circe:circe-jackson25_2.11:0.9.0 wanted version 2.5.5 - {"artifact": "com.fasterxml.jackson.core:jackson-core:2.5.5", "lang": "java", "sha1": "d0b416837b2b3907f298db2f785e9012b6881515", "sha256": "7ef985a3aa7a7ba696b959a18c584103e187d48d81c92babfe8fad495137e397", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.5.5/jackson-core-2.5.5.jar", "source": {"sha1": "e0003b29a1251bfd7368a0b8c34a6ae8e9ff1e36", "sha256": "a75336968742f6cbf932e30cf258e1d77ef1a231350d5b9cb452697a4803dc1a", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.5.5/jackson-core-2.5.5-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_core", "actual": "@com_fasterxml_jackson_core_jackson_core//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_core"}, -# duplicates in com.fasterxml.jackson.core:jackson-databind promoted to 2.5.5 + {"artifact": "com.fasterxml.jackson.core:jackson-core:2.6.7", "lang": "java", "sha1": "81838e08d5e10e33cdee7299f9682d836b78c63e", "sha256": "918c04b9f9043d51dead2192b5d94d9f065870c9f26c8defbe9c6dbc951f304f", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.6.7/jackson-core-2.6.7.jar", "source": {"sha1": "3f689e85593aeb1e8d75dcc4218245aca279d51b", "sha256": "59e6d2b524d9b1fd615809e5ba819b6111290b437e10c124ec90368907b0aa28", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-core/2.6.7/jackson-core-2.6.7-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_core", "actual": "@com_fasterxml_jackson_core_jackson_core//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_core"}, +# duplicates in com.fasterxml.jackson.core:jackson-databind promoted to 2.6.7.2 +# - com.amazonaws:aws-java-sdk-core:1.11.507 wanted version 2.6.7.2 +# - com.amazonaws:jmespath-java:1.11.507 wanted version 2.6.7.2 # - com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.3 wanted version 2.5.3 # - io.circe:circe-jackson25_2.11:0.9.0 wanted version 2.5.5 - {"artifact": "com.fasterxml.jackson.core:jackson-databind:2.5.5", "lang": "java", "sha1": "b08c3194166a230e60f56ac98bcd5cab5ee39d65", "sha256": "7733bd2a60158e448a21e4ee4578739e57a128d816410e75e3099b1494b8e58c", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.5.5/jackson-databind-2.5.5.jar", "source": {"sha1": "18480db6c085b9227ef693fb3e96ce7853c9984b", "sha256": "5ec33d76107f03f1ccdee713bd688951c614ce8dfa59662fd112684732cd9757", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.5.5/jackson-databind-2.5.5-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_databind", "actual": "@com_fasterxml_jackson_core_jackson_databind//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_databind"}, + {"artifact": "com.fasterxml.jackson.core:jackson-databind:2.6.7.2", "lang": "java", "sha1": "7e405a7ea9aa34c8477c10e1ccc023d931e1d76d", "sha256": "73d33ea49412a12e8b49a99da01ad4f0ca2bb7c52710d15a1aeac7e6ee20e9f4", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.6.7.2/jackson-databind-2.6.7.2.jar", "source": {"sha1": "c5dbcf3b1379b0540c5b1b3205301a3092353fa8", "sha256": "674da00b733fa6897a962bdd0803a34cd73a32be5063974ce4e7972e2f8f9283", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.6.7.2/jackson-databind-2.6.7.2-sources.jar"} , "name": "com_fasterxml_jackson_core_jackson_databind", "actual": "@com_fasterxml_jackson_core_jackson_databind//jar", "bind": "jar/com/fasterxml/jackson/core/jackson_databind"}, + {"artifact": "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7", "lang": "java", "sha1": "ba9e74b11135b18248e960df657a2b86ae77a079", "sha256": "956a0fb9186a796b8a6548909da1ee55004279647e261c7f540e5d49d4f199bf", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7.jar", "source": {"sha1": "6d66bfcb6c02f68161190ebc98407ac17ce47bb2", "sha256": "7edf31f544892b2acda0b4e361125ab187768009f14c83232eaf8f0b8d401fe1", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.6.7/jackson-dataformat-cbor-2.6.7-sources.jar"} , "name": "com_fasterxml_jackson_dataformat_jackson_dataformat_cbor", "actual": "@com_fasterxml_jackson_dataformat_jackson_dataformat_cbor//jar", "bind": "jar/com/fasterxml/jackson/dataformat/jackson_dataformat_cbor"}, {"artifact": "com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.3", "lang": "java", "sha1": "8fc7e5a9911c3ab4b0dd7e74f12621681835e3fc", "sha256": "fb37d4f86680af414742ccd56a897aedea678403b5eadb2f0990b687486e4be0", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.5.3/jackson-dataformat-yaml-2.5.3.jar", "source": {"sha1": "173db98f9d13cb2395d0e038dad47d79b21c6fe4", "sha256": "aa6be194db8a6740620039e8ea2f5078d97b8b5db2a42fcbd4736bc242b7ed8b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.5.3/jackson-dataformat-yaml-2.5.3-sources.jar"} , "name": "com_fasterxml_jackson_dataformat_jackson_dataformat_yaml", "actual": "@com_fasterxml_jackson_dataformat_jackson_dataformat_yaml//jar", "bind": "jar/com/fasterxml/jackson/dataformat/jackson_dataformat_yaml"}, {"artifact": "com.github.alexarchambault:argonaut-shapeless_6.2_2.11:1.2.0-M11", "lang": "scala", "sha1": "1a4b6680f12516384dd19498d3064e04afd5a276", "sha256": "bd527b2e9248c2d857dc43444f6a00fdefddcac42df8d430a247fd6a7d643cd3", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.11/1.2.0-M11/argonaut-shapeless_6.2_2.11-1.2.0-M11.jar", "source": {"sha1": "d6ad3ba9c73ac15ea9f4992e207bbc136547cb19", "sha256": "cb426bdc2df8afa7d0401a7e871ad12663573ad027be26798ed1cc10f6b908fd", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/github/alexarchambault/argonaut-shapeless_6.2_2.11/1.2.0-M11/argonaut-shapeless_6.2_2.11-1.2.0-M11-sources.jar"} , "name": "com_github_alexarchambault_argonaut_shapeless_6_2_2_11", "actual": "@com_github_alexarchambault_argonaut_shapeless_6_2_2_11//jar:file", "bind": "jar/com/github/alexarchambault/argonaut_shapeless_6_2_2_11"}, {"artifact": "com.google.guava:guava:18.0", "lang": "java", "sha1": "cce0823396aa693798f8882e64213b1772032b09", "sha256": "d664fbfc03d2e5ce9cab2a44fb01f1d0bf9dfebeccc1a473b1f9ea31f79f6f99", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0.jar", "source": {"sha1": "ad97fe8faaf01a3d3faacecd58e8fa6e78a973ca", "sha256": "0f3381ce4caa3a01602cdf0d0f4437b9ad8f347ddabbd873ded4d498e19d9590", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/google/guava/guava/18.0/guava-18.0-sources.jar"} , "name": "com_google_guava_guava", "actual": "@com_google_guava_guava//jar", "bind": "jar/com/google/guava/guava"}, {"artifact": "com.monovore:decline_2.11:0.4.2", "lang": "scala", "sha1": "6ba2ad6bb271bfe1df1a1ada1725a262d0cad437", "sha256": "c3c732cf50b616d7c23b1410ab605c33a630a4daf36ce9882b665b4e6d6ea361", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/monovore/decline_2.11/0.4.2/decline_2.11-0.4.2.jar", "source": {"sha1": "6859ade0f9d3a293086765bca0440ce01ade0280", "sha256": "bbab8cc31cd043c0cd77d96cfa8894c7609cdadf4913901c9dd7746ccd37edc6", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/com/monovore/decline_2.11/0.4.2/decline_2.11-0.4.2-sources.jar"} , "name": "com_monovore_decline_2_11", "actual": "@com_monovore_decline_2_11//jar:file", "bind": "jar/com/monovore/decline_2_11"}, - {"artifact": "commons-codec:commons-codec:1.6", "lang": "java", "sha1": "b7f0fc8f61ecadeb3695f0b9464755eee44374d4", "sha256": "54b34e941b8e1414bd3e40d736efd3481772dc26db3296f6aa45cec9f6203d86", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.jar", "source": {"sha1": "61e9f9d11fe3e12ec62f633006e99d75fd7f19c8", "sha256": "cff6a3db12b91f0fa3484d928d7863f162b0ae2789eaa3fb21604f2487611558", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6-sources.jar"} , "name": "commons_codec_commons_codec", "actual": "@commons_codec_commons_codec//jar", "bind": "jar/commons_codec/commons_codec"}, + {"artifact": "commons-codec:commons-codec:1.10", "lang": "java", "sha1": "4b95f4897fa13f2cd904aee711aeafc0c5295cd8", "sha256": "4241dfa94e711d435f29a4604a3e2de5c4aa3c165e23bd066be6fc1fc4309569", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.jar", "source": {"sha1": "11fb3d88ae7e3b757d70237064210ceb954a5a04", "sha256": "dfae68268ce86f1a18fc45b99317c13d6c9d252f001d37961e79a51076808986", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10-sources.jar"} , "name": "commons_codec_commons_codec", "actual": "@commons_codec_commons_codec//jar", "bind": "jar/commons_codec/commons_codec"}, +# duplicates in commons-logging:commons-logging promoted to 1.2 +# - com.amazonaws:aws-java-sdk-core:1.11.507 wanted version 1.1.3 +# - org.apache.httpcomponents:httpclient:4.5.5 wanted version 1.2 + {"artifact": "commons-logging:commons-logging:1.2", "lang": "java", "sha1": "4bfc12adfe4842bf07b657f0369c4cb522955686", "sha256": "daddea1ea0be0f56978ab3006b8ac92834afeefbd9b7e4e6316fca57df0fa636", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.jar", "source": {"sha1": "ecf26c7507d67782a3bbd148d170b31dfad001aa", "sha256": "44347acfe5860461728e9cb33251e97345be36f8a0dfd5c5130c172559455f41", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar"} , "name": "commons_logging_commons_logging", "actual": "@commons_logging_commons_logging//jar", "bind": "jar/commons_logging/commons_logging"}, {"artifact": "io.argonaut:argonaut_2.11:6.2.3", "lang": "scala", "sha1": "eef0bd6225b0a901a1937bb529d4b31bdb375a9e", "sha256": "94d0e1f4963e96f99cf81d2e458df3e39dadebdf3140a8a6fc87df8a47bf86c8", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/io/argonaut/argonaut_2.11/6.2.3/argonaut_2.11-6.2.3.jar", "source": {"sha1": "9d5a3b78645b6e04b129ee79129e5a04b00c2568", "sha256": "fef7bf268306b8680eca586b9a00a1ab8ef1bb238a42d0c6e32975495016a390", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/io/argonaut/argonaut_2.11/6.2.3/argonaut_2.11-6.2.3-sources.jar"} , "name": "io_argonaut_argonaut_2_11", "actual": "@io_argonaut_argonaut_2_11//jar:file", "bind": "jar/io/argonaut/argonaut_2_11"}, # duplicates in io.circe:circe-core_2.11 fixed to 0.9.3 # - io.circe:circe-generic_2.11:0.9.3 wanted version 0.9.3 @@ -101,9 +114,14 @@ def list_dependencies(): {"artifact": "javax.annotation:jsr250-api:1.0", "lang": "java", "sha1": "5025422767732a1ab45d93abfea846513d742dcf", "sha256": "a1a922d0d9b6d183ed3800dfac01d1e1eb159f0e8c6f94736931c1def54a941f", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar", "source": {"sha1": "9b1fba77edd118e13c42bda43d3c993dadd52c25", "sha256": "025c47d76c60199381be07012a0c5f9e74661aac5bd67f5aec847741c5b7f838", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0-sources.jar"} , "name": "javax_annotation_jsr250_api", "actual": "@javax_annotation_jsr250_api//jar", "bind": "jar/javax/annotation/jsr250_api"}, {"artifact": "javax.enterprise:cdi-api:1.0", "lang": "java", "sha1": "44c453f60909dfc223552ace63e05c694215156b", "sha256": "1f10b2204cc77c919301f20ff90461c3df1b6e6cb148be1c2d22107f4851d423", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar", "source": {"sha1": "3a3b9c3e5a1ec04c0c8b82e249cee7aeb4a96f9a", "sha256": "0e7c351dfe05759f84dc3eddaac1da4ef72578b494b53338829d34b12271374f", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/enterprise/cdi-api/1.0/cdi-api-1.0-sources.jar"} , "name": "javax_enterprise_cdi_api", "actual": "@javax_enterprise_cdi_api//jar", "bind": "jar/javax/enterprise/cdi_api"}, {"artifact": "javax.inject:javax.inject:1", "lang": "java", "sha1": "6975da39a7040257bd51d21a231b76c915872d38", "sha256": "91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1.jar", "source": {"sha1": "a00123f261762a7c5e0ec916a2c7c8298d29c400", "sha256": "c4b87ee2911c139c3daf498a781967f1eb2e75bc1a8529a2e7b328a15d0e433e", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/javax/inject/javax.inject/1/javax.inject-1-sources.jar"} , "name": "javax_inject_javax_inject", "actual": "@javax_inject_javax_inject//jar", "bind": "jar/javax/inject/javax_inject"}, + {"artifact": "joda-time:joda-time:2.8.1", "lang": "java", "sha1": "f5bfc718c95a7b1d3c371bb02a188a4df18361a9", "sha256": "b4670b95f75957c974284c5f3ada966040be2578f643c5c6083d262162061fa2", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/joda-time/joda-time/2.8.1/joda-time-2.8.1.jar", "source": {"sha1": "bf0996237b66ce00cd3132af179612df02ff9771", "sha256": "59086b3e0608df2eac1b21063d6bae37851173e24efc4cacd6705326408723d9", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/joda-time/joda-time/2.8.1/joda-time-2.8.1-sources.jar"} , "name": "joda_time_joda_time", "actual": "@joda_time_joda_time//jar", "bind": "jar/joda_time/joda_time"}, {"artifact": "org.apache.commons:commons-lang3:3.4", "lang": "java", "sha1": "5fe28b9518e58819180a43a850fbc0dd24b7c050", "sha256": "734c8356420cc8e30c795d64fd1fcd5d44ea9d90342a2cc3262c5158fbc6d98b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4.jar", "source": {"sha1": "b49dafc9cfef24c356827f322e773e7c26725dd2", "sha256": "4709f16a9e0f8fd83ae155083d63044e23045aac8f6f0183a2db09f492491b12", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.4/commons-lang3-3.4-sources.jar"} , "name": "org_apache_commons_commons_lang3", "actual": "@org_apache_commons_commons_lang3//jar", "bind": "jar/org/apache/commons/commons_lang3"}, - {"artifact": "org.apache.httpcomponents:httpclient:4.3.5", "lang": "java", "sha1": "9783d89b8eea20a517a4afc5f979bd2882b54c44", "sha256": "b184521bce85de3f7f57a9d6afba133b323c8752857723031ec5468d4feef8c6", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5.jar", "source": {"sha1": "9351922abd5e659dcbacb1d38b81d8069bac797b", "sha256": "0f8d35096551aa63f5777314a6856a88618b2d34c969bc8725049bf4c96f69d5", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.3.5/httpclient-4.3.5-sources.jar"} , "name": "org_apache_httpcomponents_httpclient", "actual": "@org_apache_httpcomponents_httpclient//jar", "bind": "jar/org/apache/httpcomponents/httpclient"}, - {"artifact": "org.apache.httpcomponents:httpcore:4.3.2", "lang": "java", "sha1": "31fbbff1ddbf98f3aa7377c94d33b0447c646b6e", "sha256": "abd02320e2356f89d054dae4cf02306bef20a9cf7865b3ac94ec7552b4f1528b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar", "source": {"sha1": "4809f38359edeea9487f747e09aa58ec8d3a54c5", "sha256": "947b7078b3ff3dfa21d9fc2a3e451feacd30fa6f5df8e699c508b24845886c5b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2-sources.jar"} , "name": "org_apache_httpcomponents_httpcore", "actual": "@org_apache_httpcomponents_httpcore//jar", "bind": "jar/org/apache/httpcomponents/httpcore"}, +# duplicates in org.apache.httpcomponents:httpclient promoted to 4.5.5 +# - com.amazonaws:aws-java-sdk-core:1.11.507 wanted version 4.5.5 +# - org.eclipse.aether:aether-transport-http:1.1.0 wanted version 4.3.5 + {"artifact": "org.apache.httpcomponents:httpclient:4.5.5", "lang": "java", "sha1": "1603dfd56ebcd583ccdf337b6c3984ac55d89e58", "sha256": "7e97724443ad2a25ad8c73183431d47cc7946271bcbbdfa91a8a17522a566573", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5.jar", "source": {"sha1": "9fd59f6f22326a4241f9524fdfd66a1f34824054", "sha256": "e32e7aa1f17333fc69ad61e575eb86959a52566f7e2215f8c785ec9032b6a00d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.5/httpclient-4.5.5-sources.jar"} , "name": "org_apache_httpcomponents_httpclient", "actual": "@org_apache_httpcomponents_httpclient//jar", "bind": "jar/org/apache/httpcomponents/httpclient"}, + {"artifact": "org.apache.httpcomponents:httpcore:4.4.9", "lang": "java", "sha1": "a86ce739e5a7175b4b234c290a00a5fdb80957a0", "sha256": "1b4a1c0b9b4222eda70108d3c6e2befd4a6be3d9f78ff53dd7a94966fdf51fc5", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9.jar", "source": {"sha1": "5808b4637c385d939e901eee3dc5f1121fc73a3b", "sha256": "382f1c791f3b5c19a47d0cad7865c93335fb697f51d01d370a9469a4d4b747f6", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpcore/4.4.9/httpcore-4.4.9-sources.jar"} , "name": "org_apache_httpcomponents_httpcore", "actual": "@org_apache_httpcomponents_httpcore//jar", "bind": "jar/org/apache/httpcomponents/httpcore"}, + {"artifact": "org.apache.ivy:ivy:2.4.0", "lang": "java", "sha1": "5abe4c24bbe992a9ac07ca563d5bd3e8d569e9ed", "sha256": "ce81cb234406b093b5b8de9f6f5b2a50ed0824d6a235891353e8d3e941a53970", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0.jar", "source": {"sha1": "813c562d56030e07b64eaaf61cc19212babbd191", "sha256": "96efb9949e893a7349a61f16a72ce6e2a113979f20d8d7b80610d2e66b64eef5", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/ivy/ivy/2.4.0/ivy-2.4.0-sources.jar"} , "name": "org_apache_ivy_ivy", "actual": "@org_apache_ivy_ivy//jar", "bind": "jar/org/apache/ivy/ivy"}, {"artifact": "org.apache.maven:maven-aether-provider:3.3.9", "lang": "java", "sha1": "29e8e7122f7a166ea53785cd75af0ef9d4d848d4", "sha256": "f46962583d812cd4459a4cc963113b9c52f1f9b169172354693bc9efa0b3e3cb", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.3.9/maven-aether-provider-3.3.9.jar", "source": {"sha1": "b4fb6632c420e1d83a6fb27be4e8c88cd25bb7e6", "sha256": "a9c6e8752bfeb3f4dcbdfeb3ff5e5a5638481bf451ed0b65e50cde9362f84d6e", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-aether-provider/3.3.9/maven-aether-provider-3.3.9-sources.jar"} , "name": "org_apache_maven_maven_aether_provider", "actual": "@org_apache_maven_maven_aether_provider//jar", "bind": "jar/org/apache/maven/maven_aether_provider"}, {"artifact": "org.apache.maven:maven-artifact:3.3.9", "lang": "java", "sha1": "0f43afa184555fbc6e36b3334b17246c39b30f6e", "sha256": "1f702928f2233c6ecdf308fbd8f2932ea287c7062183d3c8364b0db7e9c4445d", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9.jar", "source": {"sha1": "0dccabdddd892d97f181788c63d30f10df9cc85d", "sha256": "8985ed687dc682ff0fef32fb449005cc02eb47f860e36bf8b38b3be3cfa81ef6", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/3.3.9/maven-artifact-3.3.9-sources.jar"} , "name": "org_apache_maven_maven_artifact", "actual": "@org_apache_maven_maven_artifact//jar", "bind": "jar/org/apache/maven/maven_artifact"}, {"artifact": "org.apache.maven:maven-builder-support:3.3.9", "lang": "java", "sha1": "a96f29da7623c0e1db9824f628548fe8181f6dd0", "sha256": "462a0d711a979c44791b97422ec4e91300ae555a598f684f116d725a2b9d297b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-builder-support/3.3.9/maven-builder-support-3.3.9.jar", "source": {"sha1": "69a1a10167df7e2172fd07c0a7c3d46dfdfb8d1d", "sha256": "126114301f7e01ee50681402b8b76958dd6b1ce8358f8d747c70e33bfcdaf0df", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/apache/maven/maven-builder-support/3.3.9/maven-builder-support-3.3.9-sources.jar"} , "name": "org_apache_maven_maven_builder_support", "actual": "@org_apache_maven_maven_builder_support//jar", "bind": "jar/org/apache/maven/maven_builder_support"}, @@ -187,6 +205,7 @@ def list_dependencies(): {"artifact": "org.typelevel:macro-compat_2.11:1.1.1", "lang": "scala", "sha1": "0cb87cb74fd5fb118fede3f98075c2044616b35d", "sha256": "5200a80ad392f0b882021d6de2efb17b874cc179ff8539f9bcedabc100b7890b", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1.jar", "source": {"sha1": "363f86f631e1e95fc7989f73a0cea3ee18107cea", "sha256": "4e3438277b20cd64bce0ba31ffc7b8a74da914551c9dea46297508f879a6f220", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/typelevel/macro-compat_2.11/1.1.1/macro-compat_2.11-1.1.1-sources.jar"} , "name": "org_typelevel_macro_compat_2_11", "actual": "@org_typelevel_macro_compat_2_11//jar:file", "bind": "jar/org/typelevel/macro_compat_2_11"}, {"artifact": "org.typelevel:paiges-core_2.11:0.2.1", "lang": "scala", "sha1": "299e599df09e6ab3182eff433f84c93ab458601e", "sha256": "c176a5d76b33e09d92d192854a5d45abed625fb886845b864c94520b20b97635", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/typelevel/paiges-core_2.11/0.2.1/paiges-core_2.11-0.2.1.jar", "source": {"sha1": "194f571af2419c157783149817f0e64a29d6eb17", "sha256": "5288df95d67acbf770afe555fa3aa4fae34a21ed648546a4b87b1174db17e0eb", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/typelevel/paiges-core_2.11/0.2.1/paiges-core_2.11-0.2.1-sources.jar"} , "name": "org_typelevel_paiges_core_2_11", "actual": "@org_typelevel_paiges_core_2_11//jar:file", "bind": "jar/org/typelevel/paiges_core_2_11"}, {"artifact": "org.yaml:snakeyaml:1.12", "lang": "java", "sha1": "ebe66a6b88caab31d7a19571ad23656377523545", "sha256": "0699c809d1644b6a8209e700763bf59497df3e63756bb22f52e331e2c7e750a8", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/yaml/snakeyaml/1.12/snakeyaml-1.12.jar", "source": {"sha1": "f86c67beb22f7d1edb5d6c6a3c4dab77a23234da", "sha256": "363e9e69b052ebae3dbb0103f55180cc78971457e0da4155bb871a559c12be30", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/org/yaml/snakeyaml/1.12/snakeyaml-1.12-sources.jar"} , "name": "org_yaml_snakeyaml", "actual": "@org_yaml_snakeyaml//jar", "bind": "jar/org/yaml/snakeyaml"}, + {"artifact": "software.amazon.ion:ion-java:1.0.2", "lang": "java", "sha1": "ee9dacea7726e495f8352b81c12c23834ffbc564", "sha256": "0d127b205a1fce0abc2a3757a041748651bc66c15cf4c059bac5833b27d471a5", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2.jar", "source": {"sha1": "3077203a7e79dd126a480da0491ec60238bbb872", "sha256": "d827fc9775443697bbcdfeb8ea2d3d75bf5ad7f2ca540dabda1a5f83cd0a39de", "repository": "https://repo.maven.apache.org/maven2/", "url": "https://repo.maven.apache.org/maven2/software/amazon/ion/ion-java/1.0.2/ion-java-1.0.2-sources.jar"} , "name": "software_amazon_ion_ion_java", "actual": "@software_amazon_ion_ion_java//jar", "bind": "jar/software/amazon/ion/ion_java"}, ] def maven_dependencies(callback = jar_artifact_callback): diff --git a/WORKSPACE b/WORKSPACE index 38c2cd95..9cf8171c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -7,7 +7,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", git_repository( name = "io_bazel_rules_scala", remote = "https://github.com/bazelbuild/rules_scala", - commit = "0f89c210ade8f4320017daf718a61de3c1ac4773" # HEAD as of 2019-10-25, update this as needed + commit = "7b6360915f5d41a5c591328e2f30417550461486" # HEAD as of 2019-10-25, update this as needed ) http_archive( diff --git a/dependencies.yaml b/dependencies.yaml index 3c2b86af..33beb5f7 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -128,6 +128,22 @@ dependencies: paiges-core: lang: scala version: "0.2.1" + + com.amazonaws: + aws-java-sdk-core: + lang: java + version: "1.11.507" + aws-java-sdk-s3: + lang: java + version: "1.11.507" + aws-java-sdk-sts: + lang: java + version: "1.11.507" + + org.apache.ivy: + ivy: + lang: java + version: "2.4.0" replacements: org.scala-lang: diff --git a/src/scala/com/github/johnynek/bazel_deps/BUILD b/src/scala/com/github/johnynek/bazel_deps/BUILD index 7b82c9ad..8443f1f8 100644 --- a/src/scala/com/github/johnynek/bazel_deps/BUILD +++ b/src/scala/com/github/johnynek/bazel_deps/BUILD @@ -46,6 +46,36 @@ scala_library( exports = ["//3rdparty/jvm/org/apache/maven:maven_settings"], visibility = ["//visibility:public"]) +scala_library( + name = "s3_url_handler", + srcs = ["S3URLHandler.scala"], + deps = [ + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_core", + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_s3", + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_sts", + "//3rdparty/jvm/org/apache/ivy:ivy", + ], + exports = ["//3rdparty/jvm/org/apache/maven:maven_settings"], + visibility = ["//visibility:public"]) + +scala_library( + name = "s3_url_loader", + srcs = [ + "S3Handler.scala", + "S3URLConnection.scala" + ], + deps = [ + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_core", + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_s3", + "//3rdparty/jvm/com/amazonaws:aws_java_sdk_sts", + "//3rdparty/jvm/org/apache/ivy:ivy", + ":s3_url_handler", + ], + exports = [ + "//3rdparty/jvm/org/apache/maven:maven_settings", + ":s3_url_handler", + ], + visibility = ["//visibility:public"]) scala_library( name = "coursier_resolver", @@ -61,6 +91,7 @@ scala_library( ":depsmodel", ":graph", ":settings_loader", + ":s3_url_loader", ], visibility = ["//visibility:public"]) diff --git a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala index bff36228..11f6e24a 100644 --- a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala +++ b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala @@ -15,6 +15,15 @@ import scala.util.{Failure, Try} import scala.concurrent.{Await, ExecutionContext, Future} import scala.concurrent.duration.Duration +import java.net.{URL, URLStreamHandler, URLStreamHandlerFactory} + +private object S3URLStreamHandlerFactory extends URLStreamHandlerFactory { + def createURLStreamHandler(protocol: String): URLStreamHandler = protocol match { + case "s3" => new com.github.johnynek.bazel_deps.S3Handler + case _ => null + } +} + object CoursierResolver { // 12 concurrent downloads // most downloads are tiny sha downloads so try keep things alive @@ -39,10 +48,12 @@ class CoursierResolver(servers: List[MavenServer], ec: ExecutionContext, runTime private[this] val repos = LocalRepositories.ivy2Local :: { val settings = SettingsLoader.settings + URL.setURLStreamHandlerFactory(S3URLStreamHandlerFactory) + servers.map { case MavenServer(id, _, url) => val authentication = Option(settings.getServer(id)) .map(server => Authentication(server.getUsername, server.getPassword)) - + coursier.MavenRepository(url, authentication = authentication) } } diff --git a/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala b/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala new file mode 100644 index 00000000..2ee6e8b1 --- /dev/null +++ b/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala @@ -0,0 +1,8 @@ +package com.github.johnynek.bazel_deps + +import java.net.{URL, URLConnection, URLStreamHandler} + + +final class S3Handler extends URLStreamHandler { + def openConnection(url: URL): URLConnection = new S3URLConnection(url) +} \ No newline at end of file diff --git a/src/scala/com/github/johnynek/bazel_deps/S3URLConnection.scala b/src/scala/com/github/johnynek/bazel_deps/S3URLConnection.scala new file mode 100644 index 00000000..6b39071b --- /dev/null +++ b/src/scala/com/github/johnynek/bazel_deps/S3URLConnection.scala @@ -0,0 +1,102 @@ +package com.github.johnynek.bazel_deps + +import com.amazonaws.AmazonServiceException +import com.amazonaws.services.s3.model.{ObjectMetadata, S3Object} +import com.github.johnynek.bazel_deps.S3URLHandler +import java.io.InputStream +import java.net.{HttpURLConnection, URL} +import java.time.ZoneOffset +import java.time.format.DateTimeFormatter + +object S3URLConnection { + private val s3: S3URLHandler = new S3URLHandler() +} + +/** + * Implements an HttpURLConnection for compatibility with Coursier (https://github.com/coursier/coursier) + */ +final class S3URLConnection(url: URL) extends HttpURLConnection(url) { + import S3URLConnection.s3 + + private trait S3Response extends AutoCloseable { + def meta: ObjectMetadata + def inputStream: Option[InputStream] + } + + private case class HEADResponse(meta: ObjectMetadata) extends S3Response { + def close(): Unit = {} + def inputStream: Option[InputStream] = None + } + + private case class GETResponse(obj: S3Object) extends S3Response { + def meta: ObjectMetadata = obj.getObjectMetadata + def inputStream: Option[InputStream] = Option(obj.getObjectContent()) + def close(): Unit = obj.close() + } + + private[this] var response: Option[S3Response] = None + + def connect(): Unit = { + val (client, bucket, key) = s3.getClientBucketAndKey(url) + + try { + response = getRequestMethod.toLowerCase match { + case "head" => Option(HEADResponse(client.getObjectMetadata(bucket, key))) + case "get" => Option(GETResponse(client.getObject(bucket, key))) + case "post" => ??? + case "put" => ??? + case _ => throw new IllegalArgumentException("Invalid request method: "+getRequestMethod) + } + + responseCode = if (response.isEmpty) 404 else 200 + } catch { + case ex: AmazonServiceException => responseCode = ex.getStatusCode + } + + // Also set the responseMessage (an HttpURLConnection field) for better compatibility + responseMessage = statusMessageForCode(responseCode) + connected = true + } + + def usingProxy(): Boolean = Option(s3.getProxyConfiguration.getProxyHost).exists{ _ != "" } + + override def getInputStream: InputStream = { + if (!connected) connect() + response.flatMap{ _.inputStream }.orNull + } + + override def getHeaderField(n: Int): String = { + // n == 0 means you want the HTTP Status Line + // This is called from HttpURLConnection.getResponseCode() + if (n == 0 && responseCode != -1) { + s"HTTP/1.0 $responseCode ${statusMessageForCode(responseCode)}" + } else { + super.getHeaderField(n) + } + } + + override def getHeaderField(field: String): String = { + if (!connected) connect() + + field.toLowerCase match { + case "content-type" => response.map{ _.meta.getContentType }.orNull + case "content-encoding" => response.map{ _.meta.getContentEncoding }.orNull + case "content-length" => response.map{ _.meta.getContentLength().toString }.orNull + case "last-modified" => response.map{ _.meta.getLastModified }.map{ _.toInstant.atOffset(ZoneOffset.UTC) }.map{ DateTimeFormatter.RFC_1123_DATE_TIME.format }.orNull + case _ => null // Should return null if no value for header + } + } + + override def disconnect(): Unit = { + response.foreach{ _.close() } + } + + private def statusMessageForCode(code: Int): String = { + // I'm not sure if we care about any codes besides 200 and 404 + code match { + case 200 => "OK" + case 404 => "Not Found" + case _ => "DUMMY" + } + } +} \ No newline at end of file diff --git a/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala b/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala new file mode 100644 index 00000000..b1ce234f --- /dev/null +++ b/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala @@ -0,0 +1,422 @@ +package com.github.johnynek.bazel_deps + +import java.io.{File, FileInputStream, InputStream} +import java.net.{InetAddress, URI, URL} +import java.util.Properties +import java.util.concurrent.ConcurrentHashMap +import com.amazonaws.ClientConfiguration +import com.amazonaws.SDKGlobalConfiguration.{ACCESS_KEY_ENV_VAR, ACCESS_KEY_SYSTEM_PROPERTY, SECRET_KEY_ENV_VAR, SECRET_KEY_SYSTEM_PROPERTY} +import com.amazonaws.auth._ +import com.amazonaws.regions.Regions +import com.amazonaws.services.s3.model._ +import com.amazonaws.services.s3.{AmazonS3, AmazonS3Client, AmazonS3URI} +import com.amazonaws.services.securitytoken.{AWSSecurityTokenService, AWSSecurityTokenServiceClient} +import com.amazonaws.services.securitytoken.model.{AssumeRoleRequest, AssumeRoleResult} +import org.apache.ivy.util.url.URLHandler +import org.apache.ivy.util.{CopyProgressEvent, CopyProgressListener, Message} +import scala.collection.JavaConverters._ +import scala.util.Try +import scala.util.matching.Regex + +object S3URLHandler { + private val DOT_SBT_DIR: File = new File(System.getProperty("user.home"), ".sbt") + + // This is for matching region names in URLs or host names + private val RegionMatcher: Regex = Regions.values().map{ _.getName }.sortBy{ -1 * _.length }.mkString("|").r + + def getBucketCredentialsProvider: String => AWSCredentialsProvider = defaultCredentialsProviderChain + + private class S3URLInfo(available: Boolean, contentLength: Long, lastModified: Long) extends URLHandler.URLInfo(available, contentLength, lastModified) + + private class BucketSpecificSystemPropertiesCredentialsProvider(bucket: String) extends BucketSpecificCredentialsProvider(bucket) { + + def AccessKeyName: String = ACCESS_KEY_SYSTEM_PROPERTY + def SecretKeyName: String = SECRET_KEY_SYSTEM_PROPERTY + + protected def getProp(names: String*): String = names.map{ System.getProperty }.flatMap{ Option(_) }.head.trim + } + + private class BucketSpecificEnvironmentVariableCredentialsProvider(bucket: String) extends BucketSpecificCredentialsProvider(bucket) { + def AccessKeyName: String = ACCESS_KEY_ENV_VAR + def SecretKeyName: String = SECRET_KEY_ENV_VAR + + protected def getProp(names: String*): String = names.map{ toEnvironmentVariableName }.map{ System.getenv }.flatMap{ Option(_) }.head.trim + } + + private abstract class BucketSpecificCredentialsProvider(bucket: String) extends AWSCredentialsProvider { + def AccessKeyName: String + def SecretKeyName: String + + def getCredentials(): AWSCredentials = { + val accessKey: String = getProp(s"${AccessKeyName}.${bucket}", s"${bucket}.${AccessKeyName}") + val secretKey: String = getProp(s"${SecretKeyName}.${bucket}", s"${bucket}.${SecretKeyName}") + + new BasicAWSCredentials(accessKey, secretKey) + } + + def refresh(): Unit = {} + + // This should throw an exception if the value is missing + protected def getProp(names: String*): String + } + + private abstract class RoleBasedCredentialsProvider(providerChain: AWSCredentialsProviderChain) extends AWSCredentialsProvider { + def RoleArnKeyNames: Seq[String] + + // This should throw an exception if the value is missing + protected def getRoleArn(keys: String*): String + + def getCredentials(): AWSCredentials = { + val roleArn: String = getRoleArn(RoleArnKeyNames: _*) + + if (roleArn == null || roleArn == "") return null + + val securityTokenService: AWSSecurityTokenService = AWSSecurityTokenServiceClient.builder().withCredentials(providerChain).build() + + val roleRequest: AssumeRoleRequest = new AssumeRoleRequest() + .withRoleArn(roleArn) + .withRoleSessionName(System.currentTimeMillis.toString) + + val result: AssumeRoleResult = securityTokenService.assumeRole(roleRequest) + + new BasicSessionCredentials(result.getCredentials.getAccessKeyId, result.getCredentials.getSecretAccessKey, result.getCredentials.getSessionToken) + } + + def refresh(): Unit = {} + } + + private class RoleBasedSystemPropertiesCredentialsProvider(providerChain: AWSCredentialsProviderChain) + extends RoleBasedCredentialsProvider(providerChain) { + + val RoleArnKeyName: String = "aws.roleArn" + val RoleArnKeyNames: Seq[String] = Seq(RoleArnKeyName) + + protected def getRoleArn(keys: String*): String = keys.map( System.getProperty ).flatMap( Option(_) ).head.trim + } + + private class RoleBasedEnvironmentVariableCredentialsProvider(providerChain: AWSCredentialsProviderChain) + extends RoleBasedCredentialsProvider(providerChain) { + + val RoleArnKeyName: String = "AWS_ROLE_ARN" + val RoleArnKeyNames: Seq[String] = Seq("AWS_ROLE_ARN") + + protected def getRoleArn(keys: String*): String = keys.map( toEnvironmentVariableName ).map( System.getenv ).flatMap( Option(_) ).head.trim + } + + private class RoleBasedPropertiesFileCredentialsProvider(providerChain: AWSCredentialsProviderChain, fileName: String) + extends RoleBasedCredentialsProvider(providerChain) { + + val RoleArnKeyName: String = "roleArn" + val RoleArnKeyNames: Seq[String] = Seq(RoleArnKeyName) + + protected def getRoleArn(keys: String*): String = { + val file: File = new File(DOT_SBT_DIR, fileName) + + // This will throw if the file doesn't exist + val is: InputStream = new FileInputStream(file) + + try { + val props: Properties = new Properties() + props.load(is) + // This will throw if there is no matching properties + RoleArnKeyNames.map{ props.getProperty }.flatMap{ Option(_) }.head.trim + } finally is.close() + } + } + + private class BucketSpecificRoleBasedSystemPropertiesCredentialsProvider(providerChain: AWSCredentialsProviderChain, bucket: String) + extends RoleBasedSystemPropertiesCredentialsProvider(providerChain) { + + override val RoleArnKeyNames: Seq[String] = Seq(s"${RoleArnKeyName}.${bucket}", s"${bucket}.${RoleArnKeyName}") + } + + private class BucketSpecificRoleBasedEnvironmentVariableCredentialsProvider(providerChain: AWSCredentialsProviderChain, bucket: String) + extends RoleBasedEnvironmentVariableCredentialsProvider(providerChain) { + + override val RoleArnKeyNames: Seq[String] = Seq(s"${RoleArnKeyName}.${bucket}", s"${bucket}.${RoleArnKeyName}") + } + + private def toEnvironmentVariableName(s: String): String = s.toUpperCase.replace('-','_').replace('.','_').replaceAll("[^A-Z0-9_]", "") + + def defaultCredentialsProviderChain(bucket: String): AWSCredentialsProviderChain = { + val basicProviders: Vector[AWSCredentialsProvider] = Vector( + new BucketSpecificEnvironmentVariableCredentialsProvider(bucket), + new BucketSpecificSystemPropertiesCredentialsProvider(bucket), + DefaultAWSCredentialsProviderChain.getInstance(), + InstanceProfileCredentialsProvider.getInstance() + ) + + val basicProviderChain: AWSCredentialsProviderChain = new AWSCredentialsProviderChain(basicProviders: _*) + + val roleBasedProviders: Vector[AWSCredentialsProvider] = Vector( + new BucketSpecificRoleBasedEnvironmentVariableCredentialsProvider(basicProviderChain, bucket), + new BucketSpecificRoleBasedSystemPropertiesCredentialsProvider(basicProviderChain, bucket), + new RoleBasedEnvironmentVariableCredentialsProvider(basicProviderChain), + new RoleBasedSystemPropertiesCredentialsProvider(basicProviderChain) + ) + + new AWSCredentialsProviderChain((roleBasedProviders ++ basicProviders): _*) + } +} + +/** + * This implements the Ivy URLHandler + */ +final class S3URLHandler extends URLHandler { + import com.github.johnynek.bazel_deps.S3URLHandler._ + import org.apache.ivy.util.url.URLHandler.{UNAVAILABLE, URLInfo} + + // Cache of Bucket Name => AmazonS3 Client Instance + private val amazonS3ClientCache: ConcurrentHashMap[String,AmazonS3] = new ConcurrentHashMap() + + // Cache of Bucket Name => true/false (requires Server Side Encryption or not) + private val bucketRequiresSSE: ConcurrentHashMap[String,Boolean] = new ConcurrentHashMap() + + def isReachable(url: URL): Boolean = getURLInfo(url).isReachable + def isReachable(url: URL, timeout: Int): Boolean = getURLInfo(url, timeout).isReachable + def getContentLength(url: URL): Long = getURLInfo(url).getContentLength + def getContentLength(url: URL, timeout: Int): Long = getURLInfo(url, timeout).getContentLength + def getLastModified(url: URL): Long = getURLInfo(url).getLastModified + def getLastModified(url: URL, timeout: Int): Long = getURLInfo(url, timeout).getLastModified + def getURLInfo(url: URL): URLInfo = getURLInfo(url, 0) + + private def debug(msg: String): Unit = Message.debug("S3URLHandler."+msg) + + def getCredentialsProvider(bucket: String): AWSCredentialsProvider = { + Message.info("S3URLHandler - Looking up AWS Credentials for bucket: "+bucket+" ...") + + val credentialsProvider: AWSCredentialsProvider = try { + getBucketCredentialsProvider(bucket) + } catch { + case ex: com.amazonaws.AmazonClientException => + Message.error("Unable to find AWS Credentials.") + throw ex + } + + Message.info("S3URLHandler - Using AWS Access Key Id: "+credentialsProvider.getCredentials().getAWSAccessKeyId+" for bucket: "+bucket) + + credentialsProvider + } + + def getProxyConfiguration: ClientConfiguration = { + val configuration = new ClientConfiguration() + for { + proxyHost <- Option( System.getProperty("https.proxyHost") ) + proxyPort <- Option( System.getProperty("https.proxyPort").toInt ) + } { + configuration.setProxyHost(proxyHost) + configuration.setProxyPort(proxyPort) + } + configuration + } + + def getClientBucketAndKey(url: URL): (AmazonS3, String, String) = { + val (bucket, key) = getBucketAndKey(url) + + var client: AmazonS3 = amazonS3ClientCache.get(bucket) + + if (null == client) { + client = AmazonS3Client.builder() + .withCredentials(getCredentialsProvider(bucket)) + .withClientConfiguration(getProxyConfiguration) + .withForceGlobalBucketAccessEnabled(true) + .withRegion(getRegion(url, bucket)) + .build() + + amazonS3ClientCache.put(bucket, client) + + Message.info("S3URLHandler - Created S3 Client for bucket: "+bucket+" and region: "+client.getRegionName) + } + + (client, bucket, key) + } + + def getURLInfo(url: URL, timeout: Int): URLInfo = try { + debug(s"getURLInfo($url, $timeout)") + + val (client, bucket, key) = getClientBucketAndKey(url) + + val meta: ObjectMetadata = client.getObjectMetadata(bucket, key) + + val available: Boolean = true + val contentLength: Long = meta.getContentLength + val lastModified: Long = meta.getLastModified.getTime + + new S3URLInfo(available, contentLength, lastModified) + } catch { + case ex: AmazonS3Exception if ex.getStatusCode == 404 => UNAVAILABLE + case ex: java.net.URISyntaxException => + // We can hit this when given a URL that looks like: + // s3://maven.custom/releases/javax/ws/rs/javax.ws.rs-api/2.1/javax.ws.rs-api-2.1.${packaging.type} + // + // In that case we just ignore it and treat it as a 404. It looks like this is really a bug in IVY that has + // recently been fixed (as of 2018-03-12): https://issues.apache.org/jira/browse/IVY-1577 + // + // Original Bug: https://github.com/frugalmechanic/fm-sbt-s3-resolver/issues/45 + // Original PR: https://github.com/frugalmechanic/fm-sbt-s3-resolver/pull/46 + // + Message.warn("S3URLHandler - " + ex.getMessage) + + UNAVAILABLE + } + + def openStream(url: URL): InputStream = { + debug(s"openStream($url)") + + val (client, bucket, key) = getClientBucketAndKey(url) + val obj: S3Object = client.getObject(bucket, key) + obj.getObjectContent() + } + + /** + * A directory listing for keys/directories under this prefix + */ + def list(url: URL): Seq[URL] = { + debug(s"list($url)") + + val (client, bucket, key /* key is the prefix in this case */) = getClientBucketAndKey(url) + + // We want the prefix to have a trailing slash + val prefix: String = key.stripSuffix("/") + "/" + + val request: ListObjectsRequest = new ListObjectsRequest().withBucketName(bucket).withPrefix(prefix).withDelimiter("/") + + val listing: ObjectListing = client.listObjects(request) + + require(!listing.isTruncated, "Truncated ObjectListing! Making additional calls currently isn't implemented!") + + val keys: Seq[String] = listing.getCommonPrefixes.asScala ++ listing.getObjectSummaries.asScala.map{ _.getKey } + + val res: Seq[URL] = keys.map{ k: String => + new URL(url.toString.stripSuffix("/") + "/" + k.stripPrefix(prefix)) + } + + debug(s"list($url) => \n "+res.mkString("\n ")) + + res + } + + def download(src: URL, dest: File, l: CopyProgressListener): Unit = { + debug(s"download($src, $dest)") + + val (client, bucket, key) = getClientBucketAndKey(src) + + val event: CopyProgressEvent = new CopyProgressEvent() + if (null != l) l.start(event) + + val meta: ObjectMetadata = client.getObject(new GetObjectRequest(bucket, key), dest) + dest.setLastModified(meta.getLastModified.getTime) + + if (null != l) l.end(event) //l.progress(evt.update(EMPTY_BUFFER, 0, meta.getContentLength)) + } + + def upload(src: File, dest: URL, l: CopyProgressListener): Unit = { + debug(s"upload($src, $dest)") + + val event: CopyProgressEvent = new CopyProgressEvent() + if (null != l) l.start(event) + + val (client, bucket, key) = getClientBucketAndKey(dest) + + // Nested helper method for performing the actual PUT + def putImpl(serverSideEncryption: Boolean): PutObjectResult = { + val meta: ObjectMetadata = new ObjectMetadata() + if (serverSideEncryption) meta.setSSEAlgorithm(ObjectMetadata.AES_256_SERVER_SIDE_ENCRYPTION) + client.putObject(new PutObjectRequest(bucket, key, src).withMetadata(meta)) + } + + // Do we know for sure that this bucket requires SSE? + val requiresSSE: Boolean = bucketRequiresSSE.containsKey(bucket) + + if (requiresSSE) { + // We know we require SSE + putImpl(true) + } else { + try { + // We either don't require SSE or don't know yet so we try without SSE enabled + putImpl(false) + } catch { + case ex: AmazonS3Exception if ex.getStatusCode() == 403 => + debug(s"upload($src, $dest) failed with a 403 status code. Retrying with Server Side Encryption Enabled.") + + // Retry with SSE + val res: PutObjectResult = putImpl(true) + + // If that succeeded then save the fact that we require SSE for future requests + bucketRequiresSSE.put(bucket, true) + + Message.info(s"S3URLHandler - Enabled Server Side Encryption (SSE) for bucket: $bucket") + + res + } + } + + if (null != l) l.end(event) + } + + // I don't think we care what this is set to + def setRequestMethod(requestMethod: Int): Unit = debug(s"setRequestMethod($requestMethod)") + + // Try to get the region of the S3 URL so we can set it on the S3Client + def getRegion(url: URL, bucket: String/*, client: AmazonS3*/): Regions = { + getRegionNameFromURL(url).toOptionalRegion orElse + getRegionNameFromDNS(bucket).toOptionalRegion orElse + Option(Regions.getCurrentRegion()).map{ _.getName }.toOptionalRegion getOrElse + Regions.DEFAULT_REGION + } + + private implicit class RichStringOption(s: Option[String]) { + def toOptionalRegion: Option[Regions] = s.flatMap{ _.toOptionalRegion } + } + + private implicit class RichString(s: String) { + def toOptionalRegion: Option[Regions] = Try{ Regions.fromName(s) }.toOption + } + + def getRegionNameFromURL(url: URL): Option[String] = { + // We'll try the AmazonS3URI parsing first then fallback to our RegionMatcher + getAmazonS3URI(url).map{ _.getRegion }.flatMap{ Option(_) } orElse RegionMatcher.findFirstIn(url.toString) + } + + def getRegionNameFromDNS(bucket: String): Option[String] = { + // This gives us something like s3-us-west-2-w.amazonaws.com which must have changed + // at some point because the region from that hostname is no longer parsed by AmazonS3URI + val canonicalHostName: String = InetAddress.getByName(bucket+".s3.amazonaws.com").getCanonicalHostName() + + // So we use our regex based RegionMatcher to try and extract the region since AmazonS3URI doesn't work + RegionMatcher.findFirstIn(canonicalHostName) + } + + // Not used anymore since the AmazonS3ClientBuilder requires the region during construction +// def getRegionNameFromService(bucket: String, client: AmazonS3): Option[String] = { +// // This might fail if the current credentials don't have access to the getBucketLocation call +// Try { client.getBucketLocation(bucket) }.toOption +// } + + def getBucketAndKey(url: URL): (String, String) = { + // The AmazonS3URI constructor should work for standard S3 urls. But if a custom domain is being used + // (e.g. snapshots.maven.frugalmechanic.com) then we treat the hostname as the bucket and the path as the key + getAmazonS3URI(url).map{ amzn: AmazonS3URI => + (amzn.getBucket, amzn.getKey) + }.getOrElse { + // Probably a custom domain name - The host should be the bucket and the path the key + (url.getHost, url.getPath.stripPrefix("/")) + } + } + + def getAmazonS3URI(uri: String): Option[AmazonS3URI] = getAmazonS3URI(URI.create(uri)) + def getAmazonS3URI(url: URL) : Option[AmazonS3URI] = getAmazonS3URI(url.toURI) + + def getAmazonS3URI(uri: URI) : Option[AmazonS3URI] = try { + val httpsURI: URI = + // If there is no scheme (e.g. new URI("s3-us-west-2.amazonaws.com/")) + // then we need to re-create the URI to add one and to also make sure the host is set + if (uri.getScheme == null) new URI("https://"+uri) + // AmazonS3URI can't parse the region from s3:// URLs so we rewrite the scheme to https:// + else new URI("https", uri.getUserInfo, uri.getHost, uri.getPort, uri.getPath, uri.getQuery, uri.getFragment) + + Some(new AmazonS3URI(httpsURI)) + } catch { + case _: IllegalArgumentException => None + } +} \ No newline at end of file From 2ee03c5ddc55f521b6d55e3ba9db19470a7cb003 Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 12:58:03 -0300 Subject: [PATCH 2/9] Updating README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index eabb507c..182ae9ad 100755 --- a/README.md +++ b/README.md @@ -283,6 +283,8 @@ responsible for building correctly, and correctly exporting any dependencies tha on the compile classpath. ## Code -This code was originally forked from [pgr0ss/bazel-deps](https://github.com/pgr0ss/bazel-deps) +This code was originally forked from [pgr0ss/bazel-deps](https://github.com/pgr0ss/bazel-deps). This code was inspired by the [aether examples](https://github.com/eclipse/aether-demo/blob/322fa556494335faaf3ad3b7dbe8f89aaaf6222d/aether-demo-snippets/src/main/java/org/eclipse/aether/examples/GetDependencyTree.java) for walking maven dependencies. + +S3 Handler was based on [frugalmechanic/fm-sbt-s3-resolver](https://github.com/frugalmechanic/fm-sbt-s3-resolver/). From bcf58f5a12bd4ecf2cee651f1b124d049a9c7d13 Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 13:03:00 -0300 Subject: [PATCH 3/9] Formatting and changing to same git hash --- WORKSPACE | 2 +- src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala | 2 +- src/scala/com/github/johnynek/bazel_deps/S3Handler.scala | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 9cf8171c..38c2cd95 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -7,7 +7,7 @@ load("@bazel_tools//tools/build_defs/repo:git.bzl", git_repository( name = "io_bazel_rules_scala", remote = "https://github.com/bazelbuild/rules_scala", - commit = "7b6360915f5d41a5c591328e2f30417550461486" # HEAD as of 2019-10-25, update this as needed + commit = "0f89c210ade8f4320017daf718a61de3c1ac4773" # HEAD as of 2019-10-25, update this as needed ) http_archive( diff --git a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala index 11f6e24a..b65a8a4a 100644 --- a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala +++ b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala @@ -53,7 +53,7 @@ class CoursierResolver(servers: List[MavenServer], ec: ExecutionContext, runTime servers.map { case MavenServer(id, _, url) => val authentication = Option(settings.getServer(id)) .map(server => Authentication(server.getUsername, server.getPassword)) - + coursier.MavenRepository(url, authentication = authentication) } } diff --git a/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala b/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala index 2ee6e8b1..4eb92819 100644 --- a/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala +++ b/src/scala/com/github/johnynek/bazel_deps/S3Handler.scala @@ -2,7 +2,6 @@ package com.github.johnynek.bazel_deps import java.net.{URL, URLConnection, URLStreamHandler} - final class S3Handler extends URLStreamHandler { def openConnection(url: URL): URLConnection = new S3URLConnection(url) } \ No newline at end of file From 881f66501a9b970a2fea58deda20fdfaa073abaf Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 13:04:05 -0300 Subject: [PATCH 4/9] Removing line --- src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala | 1 - 1 file changed, 1 deletion(-) diff --git a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala index b65a8a4a..2f0d4959 100644 --- a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala +++ b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala @@ -53,7 +53,6 @@ class CoursierResolver(servers: List[MavenServer], ec: ExecutionContext, runTime servers.map { case MavenServer(id, _, url) => val authentication = Option(settings.getServer(id)) .map(server => Authentication(server.getUsername, server.getPassword)) - coursier.MavenRepository(url, authentication = authentication) } } From 792553aa8e07f3084eafa1d2129db6687aaac83a Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 13:06:06 -0300 Subject: [PATCH 5/9] Formatting --- src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala index 2f0d4959..5524b3e6 100644 --- a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala +++ b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala @@ -53,6 +53,7 @@ class CoursierResolver(servers: List[MavenServer], ec: ExecutionContext, runTime servers.map { case MavenServer(id, _, url) => val authentication = Option(settings.getServer(id)) .map(server => Authentication(server.getUsername, server.getPassword)) + coursier.MavenRepository(url, authentication = authentication) } } From f70c94d8c49f2e37b8a34534aeec96f14985ad98 Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 15:37:29 -0300 Subject: [PATCH 6/9] Removing SBT dependency --- .../johnynek/bazel_deps/S3URLHandler.scala | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala b/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala index b1ce234f..2c81edc1 100644 --- a/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala +++ b/src/scala/com/github/johnynek/bazel_deps/S3URLHandler.scala @@ -19,7 +19,6 @@ import scala.util.Try import scala.util.matching.Regex object S3URLHandler { - private val DOT_SBT_DIR: File = new File(System.getProperty("user.home"), ".sbt") // This is for matching region names in URLs or host names private val RegionMatcher: Regex = Regions.values().map{ _.getName }.sortBy{ -1 * _.length }.mkString("|").r @@ -103,27 +102,6 @@ object S3URLHandler { protected def getRoleArn(keys: String*): String = keys.map( toEnvironmentVariableName ).map( System.getenv ).flatMap( Option(_) ).head.trim } - private class RoleBasedPropertiesFileCredentialsProvider(providerChain: AWSCredentialsProviderChain, fileName: String) - extends RoleBasedCredentialsProvider(providerChain) { - - val RoleArnKeyName: String = "roleArn" - val RoleArnKeyNames: Seq[String] = Seq(RoleArnKeyName) - - protected def getRoleArn(keys: String*): String = { - val file: File = new File(DOT_SBT_DIR, fileName) - - // This will throw if the file doesn't exist - val is: InputStream = new FileInputStream(file) - - try { - val props: Properties = new Properties() - props.load(is) - // This will throw if there is no matching properties - RoleArnKeyNames.map{ props.getProperty }.flatMap{ Option(_) }.head.trim - } finally is.close() - } - } - private class BucketSpecificRoleBasedSystemPropertiesCredentialsProvider(providerChain: AWSCredentialsProviderChain, bucket: String) extends RoleBasedSystemPropertiesCredentialsProvider(providerChain) { From f5043f4ebb8c815a0bbaa883012a7d5333574910 Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 15:54:30 -0300 Subject: [PATCH 7/9] Fixing tests --- dependencies.yaml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index 33beb5f7..4a68c708 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -12,6 +12,12 @@ options: versionConflictPolicy: highest dependencies: + com.amazonaws: + aws: + lang: java + modules: [ "java-sdk-core", "java-sdk-s3", "java-sdk-sts" ] + version: "1.11.507" + com.chuusai: shapeless: lang: scala @@ -54,6 +60,11 @@ dependencies: modules: [ "", "cache", "core", "util" ] version: "2.0.0-RC4-1" + org.apache.ivy: + ivy: + lang: java + version: "2.4.0" + org.apache.maven: maven: lang: java @@ -128,22 +139,6 @@ dependencies: paiges-core: lang: scala version: "0.2.1" - - com.amazonaws: - aws-java-sdk-core: - lang: java - version: "1.11.507" - aws-java-sdk-s3: - lang: java - version: "1.11.507" - aws-java-sdk-sts: - lang: java - version: "1.11.507" - - org.apache.ivy: - ivy: - lang: java - version: "2.4.0" replacements: org.scala-lang: From 1b4ac18f3959c1bf664a151a894767ff3082dd5b Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Thu, 2 Jan 2020 16:25:00 -0300 Subject: [PATCH 8/9] Updating target_file --- 3rdparty/target_file.bzl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/3rdparty/target_file.bzl b/3rdparty/target_file.bzl index f30551b6..db5162b4 100644 --- a/3rdparty/target_file.bzl +++ b/3rdparty/target_file.bzl @@ -121,18 +121,27 @@ def list_target_data_separator(): def list_target_data(): return { +"3rdparty/jvm/com/amazonaws:aws_java_sdk_core": ["lang||||||java","name||||||//3rdparty/jvm/com/amazonaws:aws_java_sdk_core","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/amazonaws/aws_java_sdk_core","runtimeDeps|||L|||//3rdparty/jvm/commons_logging:commons_logging|||//3rdparty/jvm/joda_time:joda_time|||//3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_cbor|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind|||//3rdparty/jvm/software/amazon/ion:ion_java|||//3rdparty/jvm/org/apache/httpcomponents:httpclient","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/com/amazonaws:aws_java_sdk_kms": ["lang||||||java","name||||||//3rdparty/jvm/com/amazonaws:aws_java_sdk_kms","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/amazonaws/aws_java_sdk_kms","runtimeDeps|||L|||//3rdparty/jvm/com/amazonaws:aws_java_sdk_core|||//3rdparty/jvm/com/amazonaws:jmespath_java","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/com/amazonaws:aws_java_sdk_s3": ["lang||||||java","name||||||//3rdparty/jvm/com/amazonaws:aws_java_sdk_s3","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/amazonaws/aws_java_sdk_s3","runtimeDeps|||L|||//3rdparty/jvm/com/amazonaws:aws_java_sdk_kms|||//3rdparty/jvm/com/amazonaws:aws_java_sdk_core|||//3rdparty/jvm/com/amazonaws:jmespath_java","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/com/amazonaws:aws_java_sdk_sts": ["lang||||||java","name||||||//3rdparty/jvm/com/amazonaws:aws_java_sdk_sts","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/amazonaws/aws_java_sdk_sts","runtimeDeps|||L|||//3rdparty/jvm/com/amazonaws:aws_java_sdk_core|||//3rdparty/jvm/com/amazonaws:jmespath_java","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/com/amazonaws:jmespath_java": ["lang||||||java","name||||||//3rdparty/jvm/com/amazonaws:jmespath_java","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/amazonaws/jmespath_java","runtimeDeps|||L|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/com/fasterxml/jackson/core:jackson_annotations": ["lang||||||java","name||||||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_annotations","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/fasterxml/jackson/core/jackson_annotations","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/com/fasterxml/jackson/core:jackson_core": ["lang||||||java","name||||||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_core","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/fasterxml/jackson/core/jackson_core","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind": ["lang||||||java","name||||||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/fasterxml/jackson/core/jackson_databind","runtimeDeps|||L|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_annotations|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_core","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_cbor": ["lang||||||java","name||||||//3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_cbor","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/fasterxml/jackson/dataformat/jackson_dataformat_cbor","runtimeDeps|||L|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_core","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_yaml": ["lang||||||java","name||||||//3rdparty/jvm/com/fasterxml/jackson/dataformat:jackson_dataformat_yaml","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/fasterxml/jackson/dataformat/jackson_dataformat_yaml","runtimeDeps|||L|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_core|||//3rdparty/jvm/com/fasterxml/jackson/core:jackson_databind|||//3rdparty/jvm/org/yaml:snakeyaml","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/com/google/guava:guava": ["lang||||||java","name||||||//3rdparty/jvm/com/google/guava:guava","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/com/google/guava/guava","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/commons_codec:commons_codec": ["lang||||||java","name||||||//3rdparty/jvm/commons_codec:commons_codec","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/commons_codec/commons_codec","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/commons_logging:commons_logging": ["lang||||||java","name||||||//3rdparty/jvm/commons_logging:commons_logging","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/commons_logging/commons_logging","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/javax/annotation:jsr250_api": ["lang||||||java","name||||||//3rdparty/jvm/javax/annotation:jsr250_api","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/javax/annotation/jsr250_api","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/javax/enterprise:cdi_api": ["lang||||||java","name||||||//3rdparty/jvm/javax/enterprise:cdi_api","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/javax/enterprise/cdi_api","runtimeDeps|||L|||//3rdparty/jvm/javax/annotation:jsr250_api|||//3rdparty/jvm/javax/inject:javax_inject","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/javax/inject:javax_inject": ["lang||||||java","name||||||//3rdparty/jvm/javax/inject:javax_inject","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/javax/inject/javax_inject","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/joda_time:joda_time": ["lang||||||java","name||||||//3rdparty/jvm/joda_time:joda_time","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/joda_time/joda_time","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/apache/commons:commons_lang3": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/commons:commons_lang3","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/commons/commons_lang3","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], -"3rdparty/jvm/org/apache/httpcomponents:httpclient": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/httpcomponents:httpclient","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/httpcomponents/httpclient","runtimeDeps|||L|||//3rdparty/jvm/org/apache/httpcomponents:httpcore|||//3rdparty/jvm/commons_codec:commons_codec","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/org/apache/httpcomponents:httpclient": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/httpcomponents:httpclient","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/httpcomponents/httpclient","runtimeDeps|||L|||//3rdparty/jvm/org/apache/httpcomponents:httpcore|||//3rdparty/jvm/commons_logging:commons_logging|||//3rdparty/jvm/commons_codec:commons_codec","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/apache/httpcomponents:httpcore": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/httpcomponents:httpcore","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/httpcomponents/httpcore","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/org/apache/ivy:ivy": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/ivy:ivy","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/ivy/ivy","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/apache/maven:maven_aether_provider": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/maven:maven_aether_provider","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/maven/maven_aether_provider","runtimeDeps|||L|||//3rdparty/jvm/org/apache/maven:maven_model|||//3rdparty/jvm/org/apache/commons:commons_lang3|||//3rdparty/jvm/org/codehaus/plexus:plexus_component_annotations|||//3rdparty/jvm/org/eclipse/aether:aether_spi|||//3rdparty/jvm/org/apache/maven:maven_model_builder|||//3rdparty/jvm/org/codehaus/plexus:plexus_utils|||//3rdparty/jvm/org/eclipse/aether:aether_util|||//3rdparty/jvm/org/eclipse/aether:aether_api|||//3rdparty/jvm/org/eclipse/aether:aether_impl|||//3rdparty/jvm/org/apache/maven:maven_repository_metadata","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/apache/maven:maven_artifact": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/maven:maven_artifact","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/maven/maven_artifact","runtimeDeps|||L|||//3rdparty/jvm/org/codehaus/plexus:plexus_utils|||//3rdparty/jvm/org/apache/commons:commons_lang3","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/apache/maven:maven_builder_support": ["lang||||||java","name||||||//3rdparty/jvm/org/apache/maven:maven_builder_support","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/apache/maven/maven_builder_support","runtimeDeps|||L|||//3rdparty/jvm/org/codehaus/plexus:plexus_utils|||//3rdparty/jvm/org/apache/commons:commons_lang3","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], @@ -161,6 +170,7 @@ def list_target_data(): "3rdparty/jvm/org/sonatype/plexus:plexus_cipher": ["lang||||||java","name||||||//3rdparty/jvm/org/sonatype/plexus:plexus_cipher","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/sonatype/plexus/plexus_cipher","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/sonatype/plexus:plexus_sec_dispatcher": ["lang||||||java","name||||||//3rdparty/jvm/org/sonatype/plexus:plexus_sec_dispatcher","visibility||||||//visibility:public","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/sonatype/plexus/plexus_sec_dispatcher","runtimeDeps|||L|||//3rdparty/jvm/org/codehaus/plexus:plexus_utils|||//3rdparty/jvm/org/sonatype/plexus:plexus_cipher","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/yaml:snakeyaml": ["lang||||||java","name||||||//3rdparty/jvm/org/yaml:snakeyaml","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/org/yaml/snakeyaml","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], +"3rdparty/jvm/software/amazon/ion:ion_java": ["lang||||||java","name||||||//3rdparty/jvm/software/amazon/ion:ion_java","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||//external:jar/software/amazon/ion/ion_java","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/scala_lang:scala_compiler": ["lang||||||scala/unmangled:2.11.8","name||||||//3rdparty/jvm/org/scala_lang:scala_compiler","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||@io_bazel_rules_scala_scala_compiler//:io_bazel_rules_scala_scala_compiler","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/scala_lang:scala_library": ["lang||||||scala/unmangled:2.11.8","name||||||//3rdparty/jvm/org/scala_lang:scala_library","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||@io_bazel_rules_scala_scala_library//:io_bazel_rules_scala_scala_library","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], "3rdparty/jvm/org/scala_lang:scala_reflect": ["lang||||||scala/unmangled:2.11.8","name||||||//3rdparty/jvm/org/scala_lang:scala_reflect","visibility||||||//3rdparty/jvm:__subpackages__","kind||||||library","deps|||L|||","jars|||L|||","sources|||L|||","exports|||L|||@io_bazel_rules_scala_scala_reflect//:io_bazel_rules_scala_scala_reflect","runtimeDeps|||L|||","processorClasses|||L|||","generatesApi|||B|||false","licenses|||L|||","generateNeverlink|||B|||false"], From c7ca89be376d2b393b850535f9b61cb34ef85231 Mon Sep 17 00:00:00 2001 From: Gustavo Mendonca Date: Fri, 3 Jan 2020 15:16:42 -0300 Subject: [PATCH 9/9] Just installing the handler when needed --- .../com/github/johnynek/bazel_deps/CoursierResolver.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala index 5524b3e6..bede911a 100644 --- a/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala +++ b/src/scala/com/github/johnynek/bazel_deps/CoursierResolver.scala @@ -48,7 +48,13 @@ class CoursierResolver(servers: List[MavenServer], ec: ExecutionContext, runTime private[this] val repos = LocalRepositories.ivy2Local :: { val settings = SettingsLoader.settings - URL.setURLStreamHandlerFactory(S3URLStreamHandlerFactory) + try { + new URL("s3://example.com") + } catch { + // This means we haven't installed the handler, so install it + case _: java.net.MalformedURLException => + URL.setURLStreamHandlerFactory(S3URLStreamHandlerFactory) + } servers.map { case MavenServer(id, _, url) => val authentication = Option(settings.getServer(id))