Last active
February 17, 2017 10:50
-
-
Save FeodorFitsner/c9cad34f38719e7ae8462082651070db to your computer and use it in GitHub Desktop.
Setup Maven builds to use AppVeyor HTTP proxy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(-not $env:APPVEYOR_HTTP_PROXY_IP) { return } | |
$mavenConfig = '<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | |
http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<proxies> | |
<proxy> | |
<active>true</active> | |
<protocol>http</protocol> | |
<host>' + $env:APPVEYOR_HTTP_PROXY_IP + '</host> | |
<port>' + $env:APPVEYOR_HTTP_PROXY_PORT + '</port> | |
</proxy> | |
</proxies> | |
</settings>' | |
New-Item "$env:USERPROFILE\.m2" -ItemType Directory -Force | Out-Null | |
Set-Content "$env:USERPROFILE\.m2\settings.xml" -Value $mavenConfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment