我试图运行下面的命令来打包目标文件夹中的hpi文件
hpi:run
字符串
并观察到下面的错误消息,说该端口已被使用。我只是试图手动杀死端口,但我没有这样做的特权。是否可以通过传递参数-Dhpi. port = xxx来自定义端口no?
例外情况:
java.net.BindException:地址已在用途:在sun.nio.ch.Net.bind0绑定(本地方法)位于sun. nio. ch. Net. bind(Net.java:433)在sun. nio. ch. Net. bind(Net.java:425)在sun. nio. ch. ServerSocketServiceImpl. bind(ServerSocketAdaptor. bind)中的(ServerSocketAdaptor.java:74),网址:www.example.com(ServerConnector.java:321)位于org. eclipse. jetty. server. AbstractNetworkConnector. doStart(AbstractNetworkConnector.java:80)at org. eclipse. jetty. server. ServerConnector. doStart(ServerConnector.java:236)at org. eclipse. jetty. util. component. AbstractLifeCycle. start(AbstractLifeCycle.java:68)at org. eclipse. jetty. maven. plugin. MavenServerConnector. doStart(MavenServerConnector.java:org.eclipse.jetty.server.ServerConnector.open在org. apache. maven. plugin. DefaultBuildPluginManager. executeMojo上(DefaultBuildPluginManager.java:101)at org. apache. maven. lifecycle. internal. MojoExecutor. execute(MojoExecutor.java:209)at org. apache. maven. lifecycle. internal. MojoExecutor. execute(MojoExecutor.java:153)at org. apache. maven. lifecycle. internal. MojoExecutor. execute(MojoExecutor.java:145)at org. apache. maven. lifecycle. internal. Lifecycle ModuleBuilder. buildProject(Lifecycle ModuleBuilder.java:84)at org. apache. maven. lifecycle. internal. Lifecycle ModuleBuilder. buildProject(Lifecycle ModuleBuilder.java:59)at org. apache. maven. lifecycle. internal. Lifecycle Starter. singleThreadedBuild(Lifecycle Starter.java:183)at org. apache. maven. lifecycle. internal. Lifecycle Starter. execute(Lifecycle Starter.java:161),位于org. apache. maven. DefaultMaven. doExecute(DefaultMaven.java:320)在org. apache. maven. DefaultMaven. execute(DefaultMaven.java:156)在org. apache. maven. js. MavenCli. execute(MavenCli.java:537)在org. apache. maven. pages. MavenCli. doMain(MavenCli.java:196)at org. apache. maven. maven. mavenCli. main(MavenCli.java:141)at sun.reflect.NativeMethodslogorImpl.invoke0(Native Method)at sun. reflect. NativeMethodslogorImpl. invoke(NativeMethodslogorImpl.java:62)在sun. reflect. DelegatingMethods. Impl. invoke(DelegatingMethods. Impl. java:43)在java. lang. reflect. Method. invoke(Method.java:498)在org. codehaus. plexus. classworlds. launcher. Launcher(Launcher. java:290)在org. codehaus. plexus. classworlds. launcher. launcher(Launcher. java:230)在org. codehaus. plexus. classworlds. launcher. mainWithExitCode(Launcher. java:409)at org. codehaus. plexus. classworlds. launcher. Launcher. main(Launcher.java:352)2019 - 02 - 06 13:34:37.404:WARN:oejuc. AbstractLifecycle:main:FANORTH org.eclipse.jetty.maven.plugin.JettyServer@4802791f:java. net. BindException:Address already in用途:bind
2条答案
按热度按时间os8fio9y1#
来自Jenkins文档:
使用当前插件项目重新编译Jenkins。这只需要编译源文件,因此在编译阶段运行。
要指定HTTP端口,请使用-Djetty.port=PORT
所以,尝试使用
-Djetty.port=PORT
参数。iaqfqrcu2#
-Djetty.port=PORT
不再工作。使用mvn hpi:run -Dport=PORT
请参阅https://www.jenkins.io/doc/developer/tutorial/run/