How to set proxyPort and proxyHost within a pom
I have a JBehave suite which calls a 3rd party service. Currently I need to append -Dhttp.proxyPort=myport and -Dhttp.proxyHost=myhost when running the install phase on the command line.
Is there a way of setting those properties within the pom so I can remove them from the command?
I've tried adding them within the tag at the top. And I've also tried the surefire plugin like below:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <systemPropertyVariables> <http.proxyPort>myPort1</http.proxyPort> <http.proxyHost>myHost1</http.proxyHost> </systemPropertyVariables> </configuration> </plugin>
Try the <argLine> config element instead of <systemPropertyVariables> as described at the bottom of this example page from the Surefire plugin docs.
<configuration> <argLine>-Dhttp.proxyPort=myport -Dhttp.proxyHost=myhost</argLine> </configuration>