Code changed in jenkins
User: Cyrille Le Clerc
Path:
src/main/java/hudson/plugins/s3/ClientHelper.java
src/main/java/hudson/plugins/s3/Entry.java
src/main/java/hudson/plugins/s3/S3BucketPublisher.java
http://jenkins-ci.org/commit/s3-plugin/ff7d34914fbd52a9e44ae7029194d0351c1671c8
Log:
JENKINS-40654 Load the list of Amazon S3 regions from c.a.r.RegionMetadataProvider, stop relying on a static lists and constants.
- Adapt the http proxy logic of the plugin to discover the S3 endpoint hostname with `com.amazonaws.regions.Region#getServiceEndpoint("s3")` instead of the hardcoded constant `s3.amazonaws.com`
- Replace
- `com.amazonaws.regions.Regions` by `com.amazonaws.regions.RegionUtils#getRegionsForService("s3")`
- `com.amazonaws.services.s3.model.Region` by `com.amazonaws.regions.Region`
- For the default region used in some places of the plugin, introduce the system property `hudson.plugins.s3.DEFAULT_AMAZON_S3_REGION` to override the default `us-east-1`. Note that it would be better to no longer rely on a default AWS Region and to ask the user to specify the desired AWS Region.
The list of AWS regions can be overridden specifying a file `classpath://com/amazonaws/partitions/override/endpoints.json` matching the format defined in https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/resources/com/amazonaws/partitions/endpoints.json .
A solution to add this file in the classpath of Jenkins is to use the `java` command line parameter `-Xbootclasspath/a:/path/to/boot/classpath/folder/` and to locate `com/amazonaws/partitions/override/endpoints.json` in `/path/to/boot/classpath/folder/`.
See https://github.com/jenkinsci/s3-plugin/pull/100