2012-2-23 Thu
关于Trustie -Maven仓库简要说明
配置Maven使用本镜像库:
默认情况下,Maven依赖于中央仓库,这是为了能让Maven开箱即用,但仅仅这么做明显是错误的,这会造成大量的时间及带宽的浪费。为此我们提供Trustie的maven镜像库,这也是目前国内首个maven镜像库。访问地址如下所示:
release镜像库访问地址:http://58.20.54.58/content/groups/treleases
snapshot镜像库访问地址:http://58.20.54.58/content/groups/tsnapshots/
为了更好的使用本镜像库, 我们对maven版本做以下限制:
版本要求:Maven2.0.8及以上版本,推荐使用2.0.9
使用方法只需在$M2_HOME\conf\settings.xml中配置本镜像即可:

配置profile
在<profiles>与</profiles>之间增加如下配置:
<profile> 
    <id>development</id> 
    <repositories> 
      <repository> 
        <id>release</id> 
        <url> http://58.20.54.58/content/groups/treleases/</url> 
        <releases> 
          <enabled>true</enabled> 
        </releases> 
        <snapshots> 
          <enabled>false</enabled> 
        </snapshots> 
      </repository> 
    </repositories> 
  </profile> 
  
    <profile> 
    <id>snapshots</id> 
    <repositories> 
      <repository> 
        <id>snapshots</id> 
        <url>http://58.20.54.58/content/groups/tsnapshots/</url> 
        <releases> 
          <enabled>false</enabled> 
        </releases> 
        <snapshots> 
          <enabled>true</enabled> 
        </snapshots> 
      </repository> 
    </repositories> 
  </profile> 
激活profile
在最后的激活Profile选项中选择要激活的配置即可
<activeProfiles>
  <activeProfile>development</activeProfile> 
  <activeProfile>snapshots</activeProfile>  
</activeProfiles>
配置代理
如您需要使用代理上网,则需额外配置:
    <proxy>
      <id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>proxyuser</username>
      <password>proxypass</password>
      <host>proxy.host.net</host>
      <port>80</port>
      <nonProxyHosts>local.net,some.host.com</nonProxyHosts>
    </proxy>
将上述选项修改为您公司代理服务器地址及相应的用户名、密码即可。

如果在使用中有遇到个别jar包版本不能下载或其不在本镜像库中请与我公司联系,我们将尽快将其纳入到本镜像库中。
联系方式:
邮箱:liu_swei@cvicse.com
msn:lsw_fly@hotmail.com
↑Top↑
Feedback Opinion