maven 项目 用jetty运行报错.

具体报错如下:
[ERROR] Failed to execute goal org.mortbay.jetty:jetty-maven-plugin:8.1.16.v20140903:run (default-cli) on project tccglxt4j: Failure: Address already in use: bind -> [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/confl...

提示地址被占用, 是否要想Tomcat那样 改端口,还是重启jetty, 怎么重启啊新手第一次使用jetty,望指出明路。

阅读 5.6k
2 个回答

两种方式
mvn jetty:run -Djetty.http.port=9999

<build>
  <plugins>
    <plugin>
      <groupId>org.eclipse.jetty</groupId>
      <artifactId>jetty-maven-plugin</artifactId>
      <version>9.2.1.v20140609</version>
      <configuration>
        <httpConnector>
          <!--host>localhost</host-->
          <port>9999</port>
        </httpConnector>
      </configuration>
    </plugin>
  </plugins>
</build>

可以修改端口,也可以kill掉默认的端口,然后重启。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题