使用maven的一个方便之处是可以使用Jetty Plugin来运行web项目。只要maven jetty:run就可以把web项目跑起来了。只是很多时候我们都需要在IDE中进行调试。那如何在Eclipse中调试使用jetty Plugin的web项目呢?
    下面我们就来配置一下。

  1. 首先在Run->Externel Tools->Open Externel Tools Dialog.. 打开配置对话框,选中左边的Program节点,右键选择New然后再右边的配置里面输入Name信息,在Main tab下的Location选择你maven可执行文件的全路径(eg:/home/rory/apps/apache-maven-2.0.8/bin /mvn),Working Directory选择你的maven项目(eg:${workspace_loc:/guice-example}),Arguments里输入 jetty:run。然后再切换到Environment tab。New 一下变量,name是
    MAVEN_OPTS
    value是
    -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=4000,server=y,suspend=y
    ok,这一步设置完毕,Apply一下,close关闭
  2. 接 下来添加一个Debug,打开Run->Open Debug Dialog..打开Debug Dialog窗口,选中左边的Remote Java Application,右键New输入name,Project里选中要Debug的项目Connection Properties里的Host里设置成localhost,Port设置成上面配置的4000然后Apply一下就ok了。
  3. 接下来就可以开始调试了。首先启动第一步配置的Externel Tools配置,然后再运行第二步配置的Debug.就可以看到控制台有mvn jetty:run的输出了。接下来就开如Debug你的项目吧。:)
GitHub 加速计划 / ma / maven
4.29 K
2.65 K
下载
Maven: Apache Maven是一个开源的项目管理和构建工具,主要用于Java项目。适合需要自动化项目构建和依赖管理的开发者。特点包括约定优于配置、易于使用和社区驱动。
最近提交(Master分支:18 天前 )
2d224623 With the introduction of the build pom and raw -> build pom transformation, the construction of the effective poms in two steps become very problematic. Over the time, multiple caches have been added to the ProjectBuilder and ModelBuilder related classes which are often redundant. This PR thus changes things and move the recursive construction of the models fully into the ModelBuilder in a single call. When building build poms, a first step is done by parsing the file models from the root, then building all needed effective models from those. All the inference can be cleanly done because the builder has all the file models ready. The result will be used by the ProjectBuilder to build the projects. 7 小时前
2c6846b0 Just a simple PR to make properties file a "properties file" as majority would expect. According to spec '=', ':', or white space can be delimiter and this file IS valid, but still, users my be surprised, or tools like IDEs may misinterpret this, otherwise valid Java Properties File. 4 天前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐