jetty插件的配置

我们使用jetty插件来进行启动我们的maven项目,在pom.xml中进行配置:

  1. <plugins>
  2. <plugin>
  3. <groupId>org.eclipse.jetty</groupId>
  4. <artifactId>jetty-maven-plugin</artifactId>
  5. <version>9.3.0.M2</version>
  6. <configuration>
  7. <webAppConfig>
  8. <contextPath>/</contextPath>
  9. </webAppConfig>
  10. <httpConnector>
  11. <port>8081</port>
  12. <idleTimeout>10000</idleTimeout>
  13. </httpConnector>
  14. </configuration>
  15. </plugin>
  16. <plugin>
  17. <groupId>org.apache.maven.plugins</groupId>
  18. <artifactId>maven-war-plugin</artifactId>
  19. <version>2.4</version>
  20. <configuration>
  21. <webResources>
  22. <resource>
  23. <directory>src/main/webapp/WEB-INF</directory>
  24. </resource>
  25. </webResources>
  26. </configuration>
  27. </plugin>
  28. </plugins>
  29. </build>
  30. <profiles>
  31. <profile>
  32. <id>dev</id>
  33. <properties>
  34. <ejs.url.resources>http://127.0.0.1:8080</ejs.url.resources>
  35. <ejs.static.resources>http://127.0.0.1:8080</ejs.static.resources>
  36. <ejs.image.resources>http://127.0.0.1:8070/ejsimage</ejs.image.resources>
  37. <ejs.cookie.domain>.ejavashop.com</ejs.cookie.domain>
  38. <ejs.cookie.name>ejavashop_b2b2c_admin</ejs.cookie.name>
  39. <ejs.front.url>http://120.0.0.1:8807</ejs.front.url>
  40. <ejs.h5.url>http://120.0.0.1:8808</ejs.h5.url>
  41. <shop.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.write.url>
  42. <shop.write.username>root</shop.write.username>
  43. <shop.write.password>root</shop.write.password>
  44. <shop.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.read.url>
  45. <shop.read.username>root</shop.read.username>
  46. <shop.read.password>root</shop.read.password>
  47. <analysis.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.write.url>
  48. <analysis.write.username>root</analysis.write.username>
  49. <analysis.write.password>root</analysis.write.password>
  50. <analysis.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.read.url>
  51. <analysis.read.username>root</analysis.read.username>
  52. <analysis.read.password>root</analysis.read.password>
  53. <search.solr.url>http://127.0.0.1:8070/solr</search.solr.url>
  54. <search.solr.server>ejavashopcore</search.solr.server>
  55. <pom.log.file>F:/Users/logs/ejavashop-admin.log</pom.log.file>
  56. <pom.log.level>info</pom.log.level>
  57. </properties>
  58. </profile>
  59. </profiles>

plugin:下载我们使用的jetty插件。

profile:目的是不同环境使用不同的配置信息, 有点相当于我们的properties文件

然后我们在

这样我们就可以

使用这几个按钮进行启动了。

最后两个绿色按钮大家可能没有,那个是jrebel的按钮。

jrebel配置

我们在idea中安装了jrebel,我们那个项目可以使用jrebel来进行启动,从这里设置:

可以使用jrebel的项目,我们还可以从这里设置:

效果等同

最后设置完成的效果:

对于rebel.xml中的内容:

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
  4. Refer to https://manuals.zeroturnaround.com/jrebel/standalone/config.html for more information.
  5. -->
  6. <application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
  7. <classpath>
  8. <dir name="F:/ejavashop/ejavashop/ejavashop-admin/target/classes">
  9. </dir>
  10. </classpath>
  11. <web>
  12. <link target="/">
  13. <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp/WEB-INF">
  14. </dir>
  15. </link>
  16. <link target="/">
  17. <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp">
  18. </dir>
  19. </link>
  20. </web>
  21. </application>

jrebel监控的是F:/ejavashop/ejavashop/ejavashop-admin/target/classes下的文件哦,所以只要改动的类编译过后就可以监控到了。

使用jetty插件的时候,项目运行起来并不能够立即看到效果,需要我们进行手动编译,

执行编译快捷键是:

ctrl+shift+F9编译单个类

ctrl+F9 编译整个项目

如果我们对于某个Java进行了编译,热部署,我们看到的效果是,我们需要在使用jrebel启动我们项目的时候:

IDEA热部署(二)---jetty插件启动maven项目的更多相关文章

  1. [置顶] Maven多模块项目 eclipse热部署 Maven项目实现 tomcat热部署 二

    最近看到有好多童鞋比较热衷热部署,特别是多模块的项目,其实这热部署如果多模块比较大资源,容易内存溢出或者电脑卡住,并不建议这么做. 不过了解下也没有关系,这里我就在说说热部署的另外一种方法,因为我之前 ...

  2. 基于tomcat插件的maven多模块工程热部署(附插件源码)

    内容属原创,转载请注明出处 写在前面的话 最近一直比较纠结,归根结底在于工程的模块化拆分.以前也干过这事,但是一直对以前的结果不满意,这会重操旧业,希望搞出个自己满意的结果. 之前有什么不满意的呢? ...

  3. IntelliJ IDEA 2017.2.6 x64 配置 tomcat 启动 maven 项目

    IntelliJ IDEA 2017.2.6 x64 配置 tomcat 启动 maven 项目 1.确认 IDEA 是否启用了 tomcat 插件 2.添加 tomcat 选择 tomcat 存放路 ...

  4. maven问题:如何启动maven项目

    maven是项目构建工具,用于解决jar间的依赖,启动maven项目的命令:tomcat:run 步骤如下: 1.在pom.xml文件中配置插件,此处配置的是tomcat8 2.右击项目名,找到Run ...

  5. Intellij IDEA创建的Web项目配置Tomcat并启动Maven项目

    本篇博客讲解IDEA如何配置Tomcat. 大部分是直接上图哦. 点击如图所示的地方,进行添加Tomcat配置页面 弹出页面后,按照如图顺序找到,点击+号 tomcat Service -> L ...

  6. 探秘 Java 热部署二(Java agent premain)

    # 前言 在前文 探秘 Java 热部署 中,我们通过在死循环中重复加载 ClassLoader 和 Class 文件实现了热部署的功能,但我们也指出了缺点-----不够灵活.需要手动修改文件等操作. ...

  7. IntelliJ IDEA 14 利用JRebel实现热部署 二

    前言:今天下午和一个qq群里讨论JRebel时,忽然得到“自动部署”的奥秘--真有听君一席话,胜读十年书的感悟. 这是此群友的热部署博客:http://blog.csdn.net/martinkey/ ...

  8. IDEA 热部署 + 下载jar包放到maven中

    IDEA 热部署: 1 :  POM中加入devtools的依赖,就可以实现热部署 <dependency> <groupId>org.springframework.boot ...

  9. Eclipse中使用Maven的Jetty插件Debug Web项目

    1.环境配置 JAVA_HOME=D:\Program Files\Java\jdk1.7.0_80 JRE_HOME=%JAVA_HOME%\jre CLASSPATH=.;%JAVA_HOME%/ ...

随机推荐

  1. 通用table样式

    <html> <head> <title>通用table样式</title> <style type="text/css"&g ...

  2. Echarts数据可视化parallel平行坐标系,开发全解+完美注释

    全栈工程师开发手册 (作者:栾鹏) Echarts数据可视化开发代码注释全解 Echarts数据可视化开发参数配置全解 6大公共组件详解(点击进入): title详解. tooltip详解.toolb ...

  3. Echarts数据可视化legend图例,开发全解+完美注释

    全栈工程师开发手册 (作者:栾鹏) Echarts数据可视化开发代码注释全解 Echarts数据可视化开发参数配置全解 6大公共组件详解(点击进入): title详解. tooltip详解.toolb ...

  4. ios获取内核数目

    #include <mach/mach_host.h> unsigned int countCores() { host_basic_info_data_t hostInfo; mach_ ...

  5. 【转载】jQuery手机移动端触屏日历日期选择

    文章转载自 科e互联 http://www.internetke.com/ 原文链接:http://www.internetke.com/effects/css3/2015/0120/1222.htm ...

  6. 前端魔法堂——异常不仅仅是try/catch

    前言  编程时我们往往拿到的是业务流程正确的业务说明文档或规范,但实际开发中却布满荆棘和例外情况,而这些例外中包含业务用例的例外,也包含技术上的例外.对于业务用例的例外我们别无它法,必须要求实施人员与 ...

  7. Python C++扩展

    Python C++扩展 前段时间看了一篇文章,http://blog.jobbole.com/78859/, 颇有感触,于是就结合自己工作中的知识作了一个简单的Python移动侦测:移动侦测的算法使 ...

  8. 阻塞IO

    服务端 from socket import * server = socket(AF_INET,SOCK_STREAM) server.bind(('127.0.0.1',8080)) server ...

  9. 【NOIP2015资源+题解】

    数据下载(含cena配置文件+一套自己写的代码) 试题下载(pdf版) Day1 T1 Day1 T2 Day1 T3 Day2 T1 Day2 T2 Day3 T3

  10. 实验之-----------修改oracle实例名

    --查询当前数据库实例名称: SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS------------ ...