Coder Social home page Coder Social logo

Comments (5)

srs avatar srs commented on June 22, 2024

Hi.

Can you show me how you set up your proxy in gradle?

Thanks.

from gradle-node-plugin.

yellek avatar yellek commented on June 22, 2024

In gradle.properties:

systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=3128
systemProp.http.nonProxyHosts=localhost
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=3128
systemProp.https.nonProxyHosts=localhost

This references a cntlm proxy I have running on my local machine to deal with windows proxy weirdness.

from gradle-node-plugin.

neversleepz avatar neversleepz commented on June 22, 2024

@yellek is the 407 from Gradle or the result of running npm from gradle?
I am guessing the plugin calls out to npm which is configured differently
I've had some shocking trouble behind ntlm proxies in some corporations too and even the above wont help.

from gradle-node-plugin.

computerlove avatar computerlove commented on June 22, 2024

I am behind a proxy, and with latest node and npm everything worked with proxy set as abose plus
.npmrc:

https-proxy=...
proxy=...

from gradle-node-plugin.

Exordian avatar Exordian commented on June 22, 2024

a hacky workaround to use JVM http settings. the finalizedBy dependency could be added to npmInstall aswell unfortunately our gulp tasks require them aswell

npmInstall.dependsOn 'npmHttpProxy'
npmInstall.dependsOn 'npmHttpsProxy'
gulpBuild.finalizedBy 'removeNpmHttpProxy'
gulpBuild.finalizedBy 'removeNpmHttpsProxy'

task npmHttpProxy(type: NpmTask, group: 'node') {
    args = ['config', 'set', 'proxy', "http://${-> System.properties["http.proxyHost"]}:${-> System.properties["http.proxyPort"]}"]
}

task removeNpmHttpProxy(type: NpmTask, group: 'node') {
    args = ['config', 'delete', 'proxy']
}

task npmHttpsProxy(type: NpmTask, group: 'node') {
    args = ['config', 'set', 'https-proxy', "http://${-> System.properties["https.proxyHost"]}:${-> System.properties["https.proxyPort"]}"]
}

task removeNpmHttpsProxy(type: NpmTask, group: 'node') {
    args = ['config', 'delete', 'https-proxy']
}
npmHttpProxy.onlyIf { System.properties.containsKey("http.proxyHost") }
npmHttpsProxy.onlyIf { System.properties.containsKey("https.proxyHost") }

from gradle-node-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.