asciidoctor-gradle-examples icon indicating copy to clipboard operation
asciidoctor-gradle-examples copied to clipboard

asciidoc-to-deckjs-example:download failed

Open franck-serot opened this issue 9 years ago • 3 comments

Hi, I try to compile asciidoctor-gradle-examples but I have the following error. Could you please help me ? Best regards, Franck

:asciidoc-diagram-to-html-example:jrubyPrepareGems UP-TO-DATE :asciidoc-diagram-to-html-example:asciidoctor :asciidoc-to-all-example:asciidoctor UP-TO-DATE :asciidoc-to-deckjs-example:download FAILED

FAILURE: Build failed with an exception.

  • Where: Build file 'D:\workshop\asciidoc\asciidoctor-gradle-examples\asciidoc-to-deckjs-example\build.gradle' line: 39

  • What went wrong: Execution failed for task ':asciidoc-to-deckjs-example:download'.

    Could not connect to HTTP server on "github.com".

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 1 mins 28.441 secs

franck-serot avatar Nov 20 '15 17:11 franck-serot

The problem is on line 39 of 'D:\workshop\asciidoc\asciidoctor-gradle-examples\asciidoc-to-deckjs-example\build.gradle' with the copy of https://github.com/asciidoctor/asciidoctor-deck.js/archive/${asciidoctorBackendVersion}.zip and extract of directory asciidoctor-deck.js-${asciidoctorBackendVersion}/templates.

I can download with a browser the file https://github.com/asciidoctor/asciidoctor-deck.js/archive/${asciidoctorBackendVersion}.zip.

franck-serot avatar Nov 20 '15 17:11 franck-serot

In fact, the problem is the proxy of my company. I can build without problem at home.

How can we configure a proxy in the following task ?

task download << { mkdir downloadDir vfs { cp "zip:https://github.com/asciidoctor/asciidoctor-deck.js/archive/${asciidoctorBackendVersion}.zip!asciidoctor-deck.js-${asciidoctorBackendVersion}/templates", templateDir, recursive:true, overwrite:true cp "zip:https://github.com/imakewebthings/deck.js/archive/${deckjsVersion}.zip!deck.js-${deckjsVersion}", deckjsDir, recursive:true, overwrite:true } }

franck-serot avatar Nov 20 '15 19:11 franck-serot

I'm facing a similar issue with revealjs.

Proxy settings are documented here: https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy

If this doesn't work, this one could help (in this case: a local squid proxy): gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=3128 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=3129

And if this doesn't help, maybe this snippet for build.gradle could help (taken from the web):

task setHttpProxyFromEnv {
   def map = ['HTTP_PROXY': 'http', 'HTTPS_PROXY': 'https']
   for (e in System.getenv()) {
      def key = e.key.toUpperCase()
      if (key in map) {
         def base = map[key]
         def url = e.value.toURL()
        println " - systemProp.${base}.proxy=${url.host}:${url.port}"
        System.setProperty("${base}.proxyHost", url.host.toString())
        System.setProperty("${base}.proxyPort", url.port.toString())
      }
   }
}
build.dependsOn setHttpProxyFromEnv

(you may replace the map keys with your OS' sys env proxy settings)

jforge avatar Nov 26 '15 23:11 jforge