IDEA热部署(二)---jetty插件启动maven项目
jetty插件的配置
我们使用jetty插件来进行启动我们的maven项目,在pom.xml中进行配置:
- <plugins>
- <plugin>
- <groupId>org.eclipse.jetty</groupId>
- <artifactId>jetty-maven-plugin</artifactId>
- <version>9.3.0.M2</version>
- <configuration>
- <webAppConfig>
- <contextPath>/</contextPath>
- </webAppConfig>
- <httpConnector>
- <port>8081</port>
- <idleTimeout>10000</idleTimeout>
- </httpConnector>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.4</version>
- <configuration>
- <webResources>
- <resource>
- <directory>src/main/webapp/WEB-INF</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <profiles>
- <profile>
- <id>dev</id>
- <properties>
- <ejs.url.resources>http://127.0.0.1:8080</ejs.url.resources>
- <ejs.static.resources>http://127.0.0.1:8080</ejs.static.resources>
- <ejs.image.resources>http://127.0.0.1:8070/ejsimage</ejs.image.resources>
- <ejs.cookie.domain>.ejavashop.com</ejs.cookie.domain>
- <ejs.cookie.name>ejavashop_b2b2c_admin</ejs.cookie.name>
- <ejs.front.url>http://120.0.0.1:8807</ejs.front.url>
- <ejs.h5.url>http://120.0.0.1:8808</ejs.h5.url>
- <shop.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.write.url>
- <shop.write.username>root</shop.write.username>
- <shop.write.password>root</shop.write.password>
- <shop.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop</shop.read.url>
- <shop.read.username>root</shop.read.username>
- <shop.read.password>root</shop.read.password>
- <analysis.write.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.write.url>
- <analysis.write.username>root</analysis.write.username>
- <analysis.write.password>root</analysis.write.password>
- <analysis.read.url>jdbc:mysql://127.0.0.1:3306/ejavashop_analysis</analysis.read.url>
- <analysis.read.username>root</analysis.read.username>
- <analysis.read.password>root</analysis.read.password>
- <search.solr.url>http://127.0.0.1:8070/solr</search.solr.url>
- <search.solr.server>ejavashopcore</search.solr.server>
- <pom.log.file>F:/Users/logs/ejavashop-admin.log</pom.log.file>
- <pom.log.level>info</pom.log.level>
- </properties>
- </profile>
- </profiles>
plugin:下载我们使用的jetty插件。
profile:目的是不同环境使用不同的配置信息, 有点相当于我们的properties文件
然后我们在
这样我们就可以
使用这几个按钮进行启动了。
最后两个绿色按钮大家可能没有,那个是jrebel的按钮。
jrebel配置
我们在idea中安装了jrebel,我们那个项目可以使用jrebel来进行启动,从这里设置:
可以使用jrebel的项目,我们还可以从这里设置:
效果等同
最后设置完成的效果:
对于rebel.xml中的内容:
- <?xml version="1.0" encoding="UTF-8"?>
- <!--
- This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
- Refer to https://manuals.zeroturnaround.com/jrebel/standalone/config.html for more information.
- -->
- <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">
- <classpath>
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/target/classes">
- </dir>
- </classpath>
- <web>
- <link target="/">
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp/WEB-INF">
- </dir>
- </link>
- <link target="/">
- <dir name="F:/ejavashop/ejavashop/ejavashop-admin/src/main/webapp">
- </dir>
- </link>
- </web>
- </application>
jrebel监控的是F:/ejavashop/ejavashop/ejavashop-admin/target/classes下的文件哦,所以只要改动的类编译过后就可以监控到了。
使用jetty插件的时候,项目运行起来并不能够立即看到效果,需要我们进行手动编译,
执行编译快捷键是:
ctrl+shift+F9编译单个类
ctrl+F9 编译整个项目
如果我们对于某个Java进行了编译,热部署,我们看到的效果是,我们需要在使用jrebel启动我们项目的时候:
IDEA热部署(二)---jetty插件启动maven项目的更多相关文章
- [置顶] Maven多模块项目 eclipse热部署 Maven项目实现 tomcat热部署 二
最近看到有好多童鞋比较热衷热部署,特别是多模块的项目,其实这热部署如果多模块比较大资源,容易内存溢出或者电脑卡住,并不建议这么做. 不过了解下也没有关系,这里我就在说说热部署的另外一种方法,因为我之前 ...
- 基于tomcat插件的maven多模块工程热部署(附插件源码)
内容属原创,转载请注明出处 写在前面的话 最近一直比较纠结,归根结底在于工程的模块化拆分.以前也干过这事,但是一直对以前的结果不满意,这会重操旧业,希望搞出个自己满意的结果. 之前有什么不满意的呢? ...
- IntelliJ IDEA 2017.2.6 x64 配置 tomcat 启动 maven 项目
IntelliJ IDEA 2017.2.6 x64 配置 tomcat 启动 maven 项目 1.确认 IDEA 是否启用了 tomcat 插件 2.添加 tomcat 选择 tomcat 存放路 ...
- maven问题:如何启动maven项目
maven是项目构建工具,用于解决jar间的依赖,启动maven项目的命令:tomcat:run 步骤如下: 1.在pom.xml文件中配置插件,此处配置的是tomcat8 2.右击项目名,找到Run ...
- Intellij IDEA创建的Web项目配置Tomcat并启动Maven项目
本篇博客讲解IDEA如何配置Tomcat. 大部分是直接上图哦. 点击如图所示的地方,进行添加Tomcat配置页面 弹出页面后,按照如图顺序找到,点击+号 tomcat Service -> L ...
- 探秘 Java 热部署二(Java agent premain)
# 前言 在前文 探秘 Java 热部署 中,我们通过在死循环中重复加载 ClassLoader 和 Class 文件实现了热部署的功能,但我们也指出了缺点-----不够灵活.需要手动修改文件等操作. ...
- IntelliJ IDEA 14 利用JRebel实现热部署 二
前言:今天下午和一个qq群里讨论JRebel时,忽然得到“自动部署”的奥秘--真有听君一席话,胜读十年书的感悟. 这是此群友的热部署博客:http://blog.csdn.net/martinkey/ ...
- IDEA 热部署 + 下载jar包放到maven中
IDEA 热部署: 1 : POM中加入devtools的依赖,就可以实现热部署 <dependency> <groupId>org.springframework.boot ...
- Eclipse中使用Maven的Jetty插件Debug Web项目
1.环境配置 JAVA_HOME=D:\Program Files\Java\jdk1.7.0_80 JRE_HOME=%JAVA_HOME%\jre CLASSPATH=.;%JAVA_HOME%/ ...
随机推荐
- 通用table样式
<html> <head> <title>通用table样式</title> <style type="text/css"&g ...
- Echarts数据可视化parallel平行坐标系,开发全解+完美注释
全栈工程师开发手册 (作者:栾鹏) Echarts数据可视化开发代码注释全解 Echarts数据可视化开发参数配置全解 6大公共组件详解(点击进入): title详解. tooltip详解.toolb ...
- Echarts数据可视化legend图例,开发全解+完美注释
全栈工程师开发手册 (作者:栾鹏) Echarts数据可视化开发代码注释全解 Echarts数据可视化开发参数配置全解 6大公共组件详解(点击进入): title详解. tooltip详解.toolb ...
- ios获取内核数目
#include <mach/mach_host.h> unsigned int countCores() { host_basic_info_data_t hostInfo; mach_ ...
- 【转载】jQuery手机移动端触屏日历日期选择
文章转载自 科e互联 http://www.internetke.com/ 原文链接:http://www.internetke.com/effects/css3/2015/0120/1222.htm ...
- 前端魔法堂——异常不仅仅是try/catch
前言 编程时我们往往拿到的是业务流程正确的业务说明文档或规范,但实际开发中却布满荆棘和例外情况,而这些例外中包含业务用例的例外,也包含技术上的例外.对于业务用例的例外我们别无它法,必须要求实施人员与 ...
- Python C++扩展
Python C++扩展 前段时间看了一篇文章,http://blog.jobbole.com/78859/, 颇有感触,于是就结合自己工作中的知识作了一个简单的Python移动侦测:移动侦测的算法使 ...
- 阻塞IO
服务端 from socket import * server = socket(AF_INET,SOCK_STREAM) server.bind(('127.0.0.1',8080)) server ...
- 【NOIP2015资源+题解】
数据下载(含cena配置文件+一套自己写的代码) 试题下载(pdf版) Day1 T1 Day1 T2 Day1 T3 Day2 T1 Day2 T2 Day3 T3
- 实验之-----------修改oracle实例名
--查询当前数据库实例名称: SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS------------ ...