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.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-maven-3.6.3-bin。apache-...
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-...
- **插件**: Maven的扩展性主要体现在插件上,如`maven-compiler-plugin`用于编译Java代码,`maven-surefire-plugin`用于执行单元测试。 - **版本控制**: Maven遵循严格的版本号规则,例如`1.0.0-SNAPSHOT`表示开发...
Tomcat 是一个流行的 Web 服务器,Maven 提供了一个插件 tomcat8-maven-plugin 来实现 Maven 项目与 Tomcat 服务器的集成。下面我们将详细介绍如何使用 tomcat8-maven-plugin 插件。 tomcat8-maven-plugin 插件的...
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-deploy-plugin-2.8.2.jar
`maven-jetty-plugin`简化了Java Web应用的开发和测试过程,通过Maven的命令行即可轻松启动Jetty服务器。了解并熟练掌握这个插件的使用,对于提升开发效率有着显著的效果。在选择版本时,应根据项目的具体需求和...
maven-jar-plugin-3.1.1.jar
apache-maven-3.5.4(含windows和linux版本).zip包含如下内容: apache-maven-3.5.4-bin.tar.gz; apache-maven-3.5.4-bin.zip; apache-maven-3.5.4-src.tar.gz; apache-maven-3.5.4-src.zip; maven安装说明.txt...
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-...
apache-maven-3.8.7(含windows和linux版本).zip包含如下内容: apache-maven-3.8.7-bin.tar.gz; apache-maven-3.8.7-bin.zip; apache-maven-3.8.7-src.tar.gz; apache-maven-3.8.7-src.zip; maven安装说明.txt...
apache-maven-3.9.6-bin
Apache Maven 是一个软件项目管理和理解工具。基于项目对象模型 (POM) 的概念,Maven 可以从一条中央信息中管理项目的构建、报告和文档。 压缩包内容: apache-maven-3.8.1-bin.zip、 ...apache-maven-3.8.1-src.tar.gz
apache-maven-3.6.1
export M2_HOME=/path/to/apache-maven-3.5.4 export PATH=$M2_HOME/bin:$PATH ``` 替换`/path/to/apache-maven-3.5.4`为你的实际解压路径。保存文件并使更改生效: ```bash source ~/.bash_profile 或 source ~/....
apache-maven-3.6.3(含windows和linux版本).zip包含如下内容: apache-maven-3.6.3-bin.tar.gz; apache-maven-3.6.3-bin.zip; apache-maven-3.6.3-src.tar.gz; apache-maven-3.6.3-src.zip; maven安装说明.txt...
maven-surefire-plugin-2.22.1.jar