# Setting proxy for maven on remote host

**URL:** <https://forum.ansible.com/t/setting-proxy-for-maven-on-remote-host/13865>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [November 7, 2013, 7:08pm UTC](https://forum.ansible.com/t/setting-proxy-for-maven-on-remote-host/13865 "2013-11-07T19:08:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soumya\_Simanta](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Soumya\_Simanta](https://forum.ansible.com/u/Soumya_Simanta)\
**Post date:** [November 7, 2013, 7:08pm UTC](https://forum.ansible.com/t/setting-proxy-for-maven-on-remote-host/13865/1 "2013-11-07T19:08:10Z")

</div>

I’m trying to run a task using maven. However, my machine is behind a proxy and therefore I need to set it before executing my mvn command.  
I tried setting the proxy values in environment but it doesn’t work. Any idea how to resolve this ?

Thanks

Here is my task snippet.

- name: mvn | build the myproject  
shell: mvn clean package -DskipTests chdir=/home/ubuntu/myproject  
environment:  
http\_proxy: [http://myproxy:8080](http://myproxy:8080)  
https\_proxy: [https://proxy.sei.cmu.edu:8080](https://proxy.sei.cmu.edu:8080)

---

<div class="post-metadata">

**Author:** ![Serge\_van\_Ginderacht](https://avatars.discourse-cdn.com/v4/letter/s/b782af/32.png) [@Serge\_van\_Ginderacht](https://forum.ansible.com/u/Serge_van_Ginderacht)\
**Post date:** [November 7, 2013, 7:18pm UTC](https://forum.ansible.com/t/setting-proxy-for-maven-on-remote-host/13865/2 "2013-11-07T19:18:03Z")

</div>

I don’t think maven respects the http\_proxy\* environment vars, but needs specific configuration.

[http://maven.apache.org/guides/mini/guide-proxies.html](http://maven.apache.org/guides/mini/guide-proxies.html)
