使用Squid作为Maven仓库

有人知道如何使用Squid来代理maven仓库吗?

什么是configuration文件?

主要的问题是,Maven客户端发出HTTP请求与头控制caching行为(我想绕过)。

这是一个典型的要求:

GET /maven/proxy/jboss-public/org/richfaces/richfaces-bom/4.2.0.Final/richfaces-bom-4.2.0.Final.pom HTTP/1.1 Cache-control: no-cache Cache-store: no-store Pragma: no-cache Expires: 0 Accept-Encoding: gzip User-Agent: Apache-Maven/3.0.4 (Java 1.6.0_26; Linux 2.6.32-38-generic) Host: 192.168.2.171 Connection: Keep-Alive 

我已经在使用Apache HTTPD(并启用了disk_cache proxy_http模块),但我正在创build一个镜像,而不是代理。

这里是configuration(基于该网站 ):

 <Proxy *> Order deny,allow Allow from all </Proxy> # central ProxyPass /maven/proxy/central http://repo1.maven.org/maven2 ProxyPassReverse /maven/proxy/central http://repo1.maven.org/maven2 CacheEnable disk /maven/proxy/central # jboss-public-repository-group ProxyPass /maven/proxy/jboss-public http://repository.jboss.org/nexus/content/groups/public ProxyPassReverse /maven/proxy/jboss-public http://repository.jboss.org/nexus/content/groups/public ProxyPassReverseCookiePath /nexus /maven/proxy/jboss-public CacheEnable disk /maven/proxy/jboss-public # codehaus ProxyPass /maven/proxy/codehaus http://repository.codehaus.org/ ProxyPassReverse /maven/proxy/codehaus http://repository.codehaus.org/ CacheEnable disk /maven/proxy/codehaus CacheDirLength 2 CacheDirLevels 3 # Override default cache expiration and control CacheDefaultExpire 2419200 CacheMaxExpire 2419200 # Ignore requests to not serve from cache. Maven data never changes. CacheIgnoreCacheControl On CacheIgnoreNoLastMod On CacheStoreNoStore On # Default max file size is 64K. Set to 1GB. CacheMaxFileSize 1073741824