我将RHEL7的AWS EC2实例用于jenkins master,并在其上安装了sonarqube,nexus,maven..。安装和配置后,我在jenkins上执行了几项工作,一切似乎都很好,后来我的服务器似乎挂起了,所以我不得不停止并启动它。这使RHEL服务器的IP发生了变化。
现在,当我尝试运行要进行Maven部署的作业时... sonarqube尝试访问旧服务器IP,并且在jenkins>全局配置中进行了更改。因此,声纳法现在工作正常。但是在那之后,行家正在尝试访问我的旧服务器IP和nexus端口。我不知道该在哪里修改。
Ps:我运行的工作来自一个不属于我的git存储库,并且我没有克隆它,因此,请考虑无法访问该项目的pom.xml文件。
我遵循此步骤进行了nexus安装[1] https://devopscube.com/how-to-install-latest-sonatype-nexus-3-on-linux/
Git项目网址: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的新手,如果我没有按照格式发帖,请告诉我。
答案 0 :(得分:0)
重新启动后,使用EC2实例中新分配的IP更新 pom.xml ,并对您的maven项目进行刷新。
{
"status": "Complete",
"reportingSystem": "RAF",
"timeStamp": "2018-06-20T14:28:13+00:00",
"type": "Application",
"errorCode": "WARN.RAF.APPLICATION",
"instance": "raf-darhlc006-9080",
"message": "{\"OTA_AirLowFareSearchRS\":{\"PricedItinCount\":0,\"BrandedOneWayItinCount\":0,\"SimpleOneWayItinCount\":0,\"DepartedItinCount\":0,\"SoldOutItinCount\":0,\"AvailableItinCount\":0,\"Version\":\"4.1.0\",\"Errors\":{\"Error\":[{\"Type\":\"IF2\",\"ShortText\":\"Day/DaysRange request qualifier is not allowed in this service\",\"Code\":\"PROCESS\",\"content\":\"\"},{\"Type\":\"WORKERTHREAD\",\"ShortText\":\"2132604717632531356\",\"Code\":\"TRANSACTIONID\",\"MessageClass\":\"I\",\"content\":\"\"},{\"Type\":\"SERVER\",\"ShortText\":\"27038\",\"Code\":\"TTFHLC701\",\"MessageClass\":\"I\",\"content\":\"\"},{\"Type\":\"DRE\",\"ShortText\":\"13291\",\"Code\":\"RULEID\",\"MessageClass\":\"I\",\"content\":\"\"},{\"Type\":\"DEFAULT\",\"ShortText\":\"25238\",\"Code\":\"RULEID\",\"MessageClass\":\"I\",\"content\":\"\"},{\"Type\":\"SERVER\",\"Code\":\"MSG\",\"MessageClass\":\"I\",\"content\":\"No Availability\"},{\"Type\":\"ERR\",\"ShortText\":\"Error during Processing\",\"Code\":\"ERR\",\"content\":\"\"}]}},\"Links\":[{\"rel\":\"self\",\"href\":\"https://api-crt.cert.havail.sabre.com/v4.1.0/shop/flights?mode=live&limit=50&offset=1\"},{\"rel\":\"linkTemplate\",\"href\":\"https://api-crt.cert.havail.sabre.com/<version>/shop/flights?mode=<mode>&limit=<limit>&offset=<offset>&enabletagging=<enabletagging>\"}]}"}
此外,正如您正确地提到重启后IP更改一样,您可能需要为实例设置一个弹性IP,这样就不必每次都执行此更改。
mvn clean install -U