繁体   English   中英

nexus / maven部署到nexus服务器的旧IP

[英]nexus/maven deploy to old IP of nexus server

我将RHEL7的AWS EC2实例用于jenkins master,并在其上安装了sonarqube,nexus,maven..。 安装和配置后,我在jenkins上执行了几项工作,一切似乎都很好,后来我的服务器似乎挂起了,所以我不得不停止并启动它。 这使RHEL服务器的IP发生了变化。

现在,当我尝试运行确实进行过maven部署的工作时... sonarqube尝试访问旧服务器IP,并且在jenkins> global配置中进行了更改。 因此,声纳法现在工作正常。 但是在那之后,行家正在尝试访问我的旧服务器IP和nexus端口。 我不知道该在哪里修改。

附言:我运行的工作来自不属于我的git存储库,并且我没有克隆它,因此,请考虑无法访问该项目的pom.xml文件。

我遵循此步骤进行了nexus安装[1] https://devopscube.com/how-to-install-latest-sonatype-nexus-3-on-linux/
Git项目URL: https : //github.com/vemular1/dev-maxo-demo/

我在部署它时遇到的错误,Maven部署回购针对的是旧IP。

 --- maven-install-plugin:2.4:install (default-install) @ maxotech ---
[INFO] Installing /var/lib/jenkins/workspace/deploy/target/maxotech-1.4.jar to /var/lib/jenkins/.m2/repository/com/maxo/maxotech/1.4/maxotech-1.4.jar
[INFO] Installing /var/lib/jenkins/workspace/deploy/pom.xml to /var/lib/jenkins/.m2/repository/com/maxo/maxotech/1.4/maxotech-1.4.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ maxotech ---
Uploading to deploymentRepo: http://35.193.152.132:8081/repository/maven-releases/com/maxo/maxotech/1.4/maxotech-1.4.jar
Uploading to deploymentRepo: http://35.193.152.132:8081/repository/maven-releases/com/maxo/maxotech/1.4/maxotech-1.4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 04:20 min
[INFO] Finished at: 2018-06-20T13:47:39Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project maxotech: Failed to deploy artifacts: Could not transfer artifact com.maxo:maxotech:jar:1.4 from/to deploymentRepo (http://35.193.152.132:8081/repository/maven-releases/): Connect to 35.193.152.132:8081 [/35.193.152.132] failed: Connection timed out (Connection timed out) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Build step 'Invoke top-level Maven targets' marked build as failure
Finished: FAILURE

我是stackoverflow的新手,如果我没有按照格式发布,请告诉我。

重新启动后,使用EC2实例中新分配的IP更新pom.xml ,并刷新您的maven项目。

mvn clean install -U

另外,正如您正确地提到重启后IP更改一样,您可能需要为实例设置一个弹性IP,这样就不必每次都执行此更改。

<distributionManagement>
    <repository>
        <id>deploymentRepo</id>
        <name>Internal Releases</name>
        <url>http://35.193.152.132:8081/repository/maven-releases/</url>
    </repository>

    <snapshotRepository>
        <id>deploymentRepo</id>
        <name>Internal Releases</name>
        <url>http://35.193.152.132:8081/repository/maven-snapshots/</url>
    </snapshotRepository>

</distributionManagement>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM