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>

Answers


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>

Need Your Help

How to install visual studio in a shorter time?

visual-studio visual-studio-2013 visual-studio-2015

I have installed visual studio before on a couple of machines and installation end successfully each time, however, it takes SOOOO LONG !

If entity exists return a value in Entity Framework

c# entity-framework

I have Two tables "Customer" table and "Blacklist" customer table.