Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetInk committed May 10, 2019
1 parent a4a9f80 commit e8f8b56
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README-zh-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# jrebel-mybatisplus

Jrebel mybatplus热加载插件,支持重新加载修改后的SQL映射

([English](README.md)|[中文])

# 如何使用

## 构建插件

``` shell
git clone git@github.com:SweetInk/jrebel-mybatisplus.git
cd jrebel-mybatisplus
mvn -f jr-mybatisplus/pom.xml clean package
```

将构建好的插件`jrebel-mybatisplus/targetjr-mybatisplus.jar`拷贝至任意目录, 比如: `d:\jrebel\plugin\jr-mybatisplus.jar`

## 使用

打开你的IDE(Intellij IDEA or Eclipse),修改运行配置,增加VM参数:`-Drebel.plugins=d:\jrebel\plugin\jr-mybatisplus.jar`,然后以JRebel方式启动

检查插件是否生效:

修改你项目中的mapper xml 文件后,重新编译,如果重新请求接口,你应该会看到控制台输出 “Reloading SQL maps”



# 参考

[Custom JRebel plugins](http://manuals.zeroturnaround.com/jrebel/advanced/custom.html#jrebelcustom)

[Getting Started with Javassist](http://www.javassist.org/tutorial/tutorial.html)
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,38 @@
# jrebel-mybatisplus

A hook plugin for Support MybatisPlus that reloads modified SQL maps.
([English]|[中文](README-zh-CN.md))

# How to use

Running the web app with the custom plugin
Compile the JRebel plugin like a regular maven project: `mvn -f jr-mybatisplus/pom.xml clean package`. This will produce a plugin jar in jr-mybatisplus/target/jr-mybatisplus.jar. To enable the plugin, pass the plugin’s path to JRebel using a JVM argument: `-Drebel.plugins=/path/to/jr-mybatisplus.jar`.


Running from the IDE
Compile the sample application and the sample plugin using mvn clean package. Configure your favourite web server with the JVM argument -Drebel.plugins=/path/to/jr-mybatisplus.jar, start it with JRebel and deploy the sample application.


Running from the command line
Compile the sample application and the sample plugin using `mvn clean package`. Attach the JRebel agent as usual, but also add the path to the sample plugin:

Linux and Mac OS:
```
export MAVEN_OPTS="<agentpath argument> -Drebel.plugins=/path/to/jr-mybatisplus.jar"
mvn -f demo-application/pom.xml jetty:run
```
Windows:
```
set MAVEN_OPTS="<agentpath argument> -Drebel.plugins=/path/to/jr-mybatisplus.jar"
mvn -f demo-application\pom.xml jetty:run
```
Check that the plugin works:

Modify your `Mybatis mapper` xml file. The “Reloading SQL maps” message should appear in the console at the start of the next request.


# Reference

[Custom JRebel plugins](http://manuals.zeroturnaround.com/jrebel/advanced/custom.html#jrebelcustom)

[Getting Started with Javassist](http://www.javassist.org/tutorial/tutorial.html)

0 comments on commit e8f8b56

Please sign in to comment.