Bug 53709

Summary: proxy for ant download-jars
Product: JMeter - Now in Github Reporter: ejaenv <enricjaen>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED DUPLICATE    
Severity: normal CC: p.mouawad
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description ejaenv 2012-08-13 08:21:02 UTC
ant download-jar doesn't work when you are behind a proxy.

I have tried this and works. If you want I can create a patch. The question is, where should the proxy values be defined? The build.properties I think is not the place as it is commited in trunk . There should be a user.properties, shouldn't it?


      <target name="proxy">
            <property name="proxy.host" value=".."/>
	    <property name="proxy.port" value=".."/>
	    <property name="proxy.user" value=".."/>
	    <property name="proxy.pass" value=".."/>
	    <setproxy proxyhost="${proxy.host}" proxyport="${proxy.port}"
	      proxyuser="${proxy.user}" proxypassword="${proxy.pass}"/>
	</target>
	
    <!-- Download all missing jars.-->
    <target name="download_jars" description="Download any missing jar files">
    	<antcall target="proxy"/>
    	
        <!-- build.dir may be needed as a temporary work area -->
        <mkdir dir="${build.dir}" />
        <antcall target="_process_all_jars">
            <param name="_get_file" value="true"/>
        </antcall>
    </target>
Comment 1 Milamber 2012-08-13 08:40:09 UTC
Ant tasks works behind a proxy server.

Please use ANT_OPTS environment variable.
http://ant.apache.org/manual/proxy.html

On Linux (bash), before ant download_jars :

export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080 -Dhttp.user=login -Dhttp.pass=xxxxx"

ant download_jars  (not download-jar)


Please use the JMeter dev list to ask your questions. Bugzilla isn't a support forum. 
Thanks
Comment 2 ejaenv 2012-08-13 09:59:57 UTC
(In reply to comment #1)
> Ant tasks works behind a proxy server.
> 
> Please use ANT_OPTS environment variable.
> http://ant.apache.org/manual/proxy.html
> 
> On Linux (bash), before ant download_jars :
> 
> export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080
> -Dhttp.user=login -Dhttp.pass=xxxxx"
> 
> ant download_jars  (not download-jar)
> 
> 
> Please use the JMeter dev list to ask your questions. Bugzilla isn't a
> support forum. 
> Thanks

Ok, thanks, I should first asked in a list.
Comment 3 Felix Schumacher 2017-03-17 21:38:45 UTC
As Michael pointed out in 60886, the usage of the environment entry might lead to leakage of passwords, as those values will be shown in tools like top or ps, when ant runs.

So I think we should add an option of adding proxy settings via property files (like the mechanism used in tomcat ant file for years).

*** This bug has been marked as a duplicate of bug 60886 ***
Comment 4 Philippe Mouawad 2017-03-17 21:40:22 UTC
(In reply to Felix Schumacher from comment #3)
> As Michael pointed out in 60886, the usage of the environment entry might
> lead to leakage of passwords, as those values will be shown in tools like
> top or ps, when ant runs.
> 
> So I think we should add an option of adding proxy settings via property
> files (like the mechanism used in tomcat ant file for years).
+1
> 
> *** This bug has been marked as a duplicate of bug 60886 ***
Comment 5 The ASF infrastructure team 2022-09-24 20:37:50 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2880