1. add dependence in pom.xml
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.26</version> // not sure why failed if don't specify the version #
</dependency>
2. add debugger start up class
package debugger;
import org.mortbay.jetty.Server;
import org.mortbay.jetty.nio.SelectChannelConnector;
import org.mortbay.jetty.webapp.WebAppContext;
public class JettyWebStarter {
public static void main(String[] args) throws Exception {
Server server = new Server();
SelectChannelConnector connector = new SelectChannelConnector();
connector.setPort(80); // change this port number if it is taken by other program
server.addConnector(connector);
WebAppContext context = new WebAppContext();
context.setContextPath("/");
context.setDescriptor("src/main/webapp/WEB-INF/web.xml");
context.setResourceBase("src/main/webapp");
server.setHandler(context);
server.start();
}
}
3. mvn clean install
4. debug this class and you are able to debug the code now.
-------------------- or you can -----------------
4. Create a new Program in External Tools Configuration
Location: C:\JSpace\Software\apache-maven-3.0.4\bin\mvn.bat
Working Directory: ${workspace_loc:/petstore-web}
Arguments: jetty:run
!!! NOTE, go to Environment Tab !!!
please make sure your environment variables are set correctly.
MAVEN_OPTS: -Xdebug -Xrunjdwp:transport=dt_socket,address=
1044,server=y,suspend=n
5. Create a new Remote Java Application in Debug Configurations
use the same Port specified in MAVEN_OPTS.
分享到:
相关推荐
apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-maven-3.8.6-bin.zip apache-...
apache-maven-3.8.6-bin.tar.tz--test apache-maven-3.8.6-bin.tar.tz--test apache-maven-3.8.6-bin.tar.tz--test apache-maven-3.8.6-bin.tar.tz--test apache-maven-3.8.6-bin.tar.tz--test apache-maven-3.8.6-...
2) A directory called "apache-maven-3.x.y" will be created. 3) Add the bin directory to your PATH, eg: Unix-based operating systems (Linux, Solaris and Mac OS X) export PATH=/usr/local/apache-...
apache-maven-3.8.8.zip压缩包内容: apache-maven-3.8.8-bin.tar.gz apache-maven-3.8.8-bin.zip apache-maven-3.8.8-src.tar.gz apache-maven-3.8.8-src.zip
maven资源 apache-maven-3.3.9-bin.zip
maven-deploy-plugin-2.8.2.jar
apache-maven-3.9.6-bin
apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-...
maven-jar-plugin-3.1.1.jar
maven-antrun-plugin-3.0.0.jar
apache-maven-3.6.1.zip分享给需要的同学 apache-maven-3.6.1.zip分享给需要的同学 apache-maven-3.6.1.zip分享给需要的同学 apache-maven-3.6.1.zip分享给需要的同学 apache-maven-3.6.1.zip分享给需要的同学apache...
Apache Maven 是一个软件项目管理和理解工具。基于项目对象模型 (POM) 的概念,Maven 可以从一条中央信息中管理项目的构建、报告和文档。 压缩包内容: apache-maven-3.8.1-bin.zip、 ...apache-maven-3.8.1-src.tar.gz
maven-shared-utils-3.2.1.jar
maven-surefire-plugin-2.22.1.jar
apache-maven-3.9.0-bin.tar.gz
apache-maven-3.6.1-bin
maven是个项目管理工具,如果我们不告诉它我们的代码要使用什么样的jdk版本编译的话,它就会用maven-compiler-plugin默认的jdk版本来进行处理,这样就容易出现版本不匹配,以至于可能导致编译不通过的问题。...
apache-maven-3.5.3-bin.zip apache-maven-3.6.0-bin.tar.gz win linux合集,欢迎下载!
maven-install-plugin-2.4.jar