Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asciidoc-to-deckjs-example:download failed #14

Open
franck-serot opened this issue Nov 20, 2015 · 3 comments
Open

asciidoc-to-deckjs-example:download failed #14

franck-serot opened this issue Nov 20, 2015 · 3 comments

Comments

@franck-serot
Copy link

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
Copy link
Author

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
Copy link
Author

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
}
}

@jforge
Copy link

jforge commented Nov 26, 2015

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants