【问题标题】:Nexus server with unexpected behavior具有意外行为的 Nexus 服务器
【发布时间】:2018-08-08 04:31:16
【问题描述】:

我在我的计算机上安装了一个本地 nexus,将其用作我公司拥有的众多 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>

我错过了什么?

【问题讨论】:

  • 首先是否有充分的理由将默认端口从 8081 更改为 2312 ?此外,您检查过 Nexus 的日志文件吗?
  • 我更改默认端口只是为了避免与本地运行的另一台服务器发生冲突...日志上没有打印...

标签: maven nexus


【解决方案1】:

你有没有像这样设置你的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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-11-26
    • 2015-05-04
    • 2018-02-08
    • 2018-11-29
    • 2015-05-29
    相关资源
    最近更新 更多