使用nexus预取maven-metadata.xml

时间:2014-04-19 22:17:06

标签: maven maven-3 nexus maven-metadata

使用maven3配置文件settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings>
  <!--<host>webproxy</host>-->
  <mirrors>
    <mirror>
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://richter-local.de:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
    <servers>
        <server>
            <id>nexus</id>
        </server>
    </servers>
  <profiles>
    <profile>
      <id>nexus</id>
      <!--Enable snapshots for the built in central repo to direct -->
      <!--all requests to nexus via the mirror -->
      <repositories>
        <repository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>interval:10080</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>interval:10080</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases>
            <enabled>true</enabled>
            <updatePolicy>interval:10080</updatePolicy>
          </releases>
          <snapshots>
            <enabled>true</enabled>
            <updatePolicy>interval:10080</updatePolicy>
          </snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
  <interactiveMode>true</interactiveMode>
  <usePluginRegistry>false</usePluginRegistry>
  <offline>false</offline>
</settings>

和nexus maven代理(版本2.7.2-03)我必须等到每天00:00之后每天maven-metadata.xml文件的一些非常慢的下载(对于某些KB,大约需要5分钟)应该在几秒钟内转移。如何预取这些文件以便将它们下载到我的本地nexus实例?

1 个答案:

答案 0 :(得分:0)

听起来你有一个或多个代理存储库,它们的遥控器响应非常慢。每天一次,这些缓存超时到期,导致检索速度非常慢。

有关如何调试此功能的信息,请参阅此处,并配置Nexus以防止问题再次发生:

https://support.sonatype.com/entries/25884097-Troubleshooting-slow-maven-metadata-xml-download-speeds