如何在docker中使用Angular 2调试Maven插件中的Java [英] How to debug java in maven plug with angular 2, tomee in docker

查看:69
本文介绍了如何在docker中使用Angular 2调试Maven插件中的Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有2个maven插件的项目。

I have a project with 2 maven plugin.


  1. 插件在Java中。

  2. 另一个插件是angular2。

  3. 在这2个maven插件中是docker。

在docker容器中,tomee和mysql运行。我想用前端调试Java,这意味着通过点击 http:// localhost:8080 / mywebapp ,系统应在我在后端设置的断点处停止( Java文件)。我正在使用IntelliJ。

In docker container, tomee and mysql runs. I want to debug java with the front-end which means by hitting http://localhost:8080/mywebapp , the system should stop at the break point I set in backend (java file). I am using IntelliJ.

有人知道怎么做吗?

推荐答案

在Docker容器中运行应用程序的唯一方法是远程调试。您可以

Since you are running you application in docker container remote debugging is the only way. you could,


  1. 通过遵循这些步骤。这意味着您必须暴露除tomcat 8080端口之外的其他端口。

  2. 在DockerFile中暴露端口并将其映射到主机上。可以使用-p标志或执行来完成。

  3. 在intellij-idea中,执行远程调试。这是当您按下 http:// localhost:8080 / mywebapp 时。

  1. Attach remote debugging information by following these steps. This will means that you have to expose additional port apart from tomcat 8080 port.
  2. Expose port in DockerFile and map it on the host. This could be done using -p flag or doing this.
  3. In intellij-idea, do remote debugging. This is when you hit http://localhost:8080/mywebapp.

这篇关于如何在docker中使用Angular 2调试Maven插件中的Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆