Building cordova when you are behind a proxy

When I try to build the cordova android version, I got the following error:

   > Could not GET
   > Connection to refused
   > Failed to list versions for
   > Unable to load Maven meta-data from

This is because I am behind a proxy. I set the proxy server in the environment settings and in my windows system settings. The cordova plugins are downloaded correctly.