literalice / gradle-aws-s3-sync

The gradle task for synchronizing a local directory with a AWS S3 bucket.
37 stars 23 forks source link

Proxy settings are not applied to RestS3Service #9

Open karmazyn opened 9 years ago

karmazyn commented 9 years ago

Setting proxy in config file does not work. JetS3tProperties class is read after the connection is configured in RestS3Service. Service reads jets3t.properties file hardcoded in source code instead of provided config.

08:48:27.683 [DEBUG] [org.jets3t.service.Jets3tProperties] httpclient.proxy-autodetect=true
08:48:27.706 [DEBUG] [org.jets3t.service.utils.RestUtils] Unable to set proxy configuration
java.lang.ExceptionInInitializerError
...
Caused by: java.lang.IllegalArgumentException: Host name may not be blank

my proxy configuration:

httpclient.proxy-autodetect=false
httpclient.proxy-host=myhost
httpclient.proxy-port=myport
foto-andreas commented 6 years ago

A workaround is to add the directory with the jet3st.properties file to the classpath in the gradle build script:

    dependencies {
        classpath 'com.monochromeroad.gradle-plugins:gradle-aws-s3-sync:0.10',
            files('gradle')
    }

Problem is that it is read once from file system an once from classpath. In the example "gradle" is the directory with the jet3st.properties file.