我正在尝试在jenkins中发布一个项目并找到一个未找到主机的异常。
Caused by: java.lang.RuntimeException: java.net.UnknownHostException: XXXXXXXXXXXXXXX: nodename nor servname provided, or not known
at org.apache.maven.scm.provider.perforce.PerforceScmProvider.generateDefaultClientspecName(PerforceScmProvider.java:420)
at org.apache.maven.scm.provider.perforce.PerforceScmProvider.getClientspecName(PerforceScmProvider.java:395)
at org.apache.maven.scm.provider.perforce.command.checkout.PerforceCheckOutCommand.executeCheckOutCommand(PerforceCheckOutCommand.java:75)
at org.apache.maven.scm.command.checkout.AbstractCheckOutCommand.executeCommand(AbstractCheckOutCommand.java:82)
at org.apache.maven.scm.command.AbstractCommand.execute(AbstractCommand.java:59)
通过源读取它看起来就像在这一行上引发了异常:
InetAddress.getLocalHost().getHostName();
由于除了更改代码之外我没有控制发布插件的源代码,有什么方法可以解决这个问题吗?
答案 0 :(得分:0)
我找到了解决方法。在命令行上运行命令
hostname <your-ip or actual-hostname>