Nexus服务器出现异常行为

时间:2018-08-07 17:11:13

标签: maven nexus

我已经在计算机上安装了本地关系,以将其用作我公司拥有的众多关系服务器的镜像。

我认为它是可行的,因为如果在浏览器中访问以下URL:

http://localhost:2312/repository/my_repo/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

它显示.pom文件的内容。

但是当我在提示符下运行mvn clean install时,得到以下信息:

Failed to transfer file: http://localhost:2312/repository/my_repo/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom. Return code is: 504 , ReasonPhrase:Gateway Timeout.

在我的maven settings.xml中,我输入了以下内容:

<mirrors>
    <mirror>
        <id>Nexus</id>
        <name>Nexus Local</name>
        <url>http://localhost:2312/repository/my_repo/</url>
        <mirrorOf>*</mirrorOf>
    </mirror>
</mirrors>

我想念什么?

1 个答案:

答案 0 :(得分:0)

您是否像这样设置settings.xml

<settings>
  <mirrors>
    <mirror>
      <!--This sends everything else to /public -->
      <id>nexus</id>
      <mirrorOf>*</mirrorOf>
      <url>http://localhost:8081/nexus/content/groups/public</url>
    </mirror>
  </mirrors>
  <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></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </repository>
      </repositories>
     <pluginRepositories>
        <pluginRepository>
          <id>central</id>
          <url>http://central</url>
          <releases><enabled>true</enabled></releases>
          <snapshots><enabled>true</enabled></snapshots>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <activeProfiles>
    <!--make the profile active all the time -->
    <activeProfile>nexus</activeProfile>
  </activeProfiles>
</settings>