我将 Maven 3.0.4 与 jboss-as-maven-plugin 一起用于嵌入式 JBoss 服务器。我想自定义 JBoss 侦听请求的端口,通常是 8080。但是,我无法使用配置部分中的“端口”属性对其进行自定义。下面是我的配置:
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.4.Final</version>
<configuration>
<port>8082</port>
</configuration>
</plugin>
我查看了 jboss-as-maven-plugin 的官方文档:https ://docs.jboss.org/jbossas/7/plugins/maven/latest/run-mojo.html 但不知道其中有什么问题.
在 server.log 中,没有错误消息,但停在下面:
...
12:52:03,385 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Pausing Coyote HTTP/1.1 on http--127.0.0.1-8080
12:52:03,385 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-8) Stopping Coyote HTTP/1.1 on http--127.0.0.1-8080
12:52:12,859 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
12:52:12,866 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
12:52:12,876 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
12:52:12,877 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
12:52:12,888 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
12:52:12,910 INFO [org.jboss.as.connector] (MSC service thread 1-2) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)
12:52:12,936 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
12:52:12,964 INFO [org.jboss.as.security] (MSC service thread 1-5) JBAS013100: Current PicketBox version=4.0.7.Final
12:52:12,978 INFO [org.jboss.as.naming] (MSC service thread 1-8) JBAS011802: Starting Naming Service
12:52:13,016 INFO [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]
12:52:13,078 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)
12:52:13,112 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA
12:52:13,393 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-4) JBAS015012: Started FileSystemDeploymentService for directory D:\mshello\SWS-Client\target\jboss-as-run\jboss-as-7.1.1.Final\standalone\deployments
12:52:13,400 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:4447
12:52:13,401 INFO [org.jboss.as.remoting] (MSC service thread 1-8) JBAS017100: Listening on /127.0.0.1:9999
12:52:13,408 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
12:52:13,523 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]
12:52:15,125 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://127.0.0.1:9990
12:52:15,127 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 3534ms - Started 133 of 208 services (74 services are passive or on-demand)
<< stopped here >>
我可以看到 [org.apache.coyote.http11.Http11Protocol] 还在监听 http--127.0.0.1-8080,是这个原因吗?如果是,如何在 pom.xml 中配置它?
去掉8082端口的全部配置后,服务器就可以正常启动成功了mvn jboss-as:run
。
有什么建议吗?