Maven发布插件抛出Hostname未找到异常?

时间:2013-05-22 23:09:37

标签: maven-release-plugin

我正在尝试在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();

由于除了更改代码之外我没有控制发布插件的源代码,有什么方法可以解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

我找到了解决方法。在命令行上运行命令

hostname <your-ip or actual-hostname>