Skip to content

Commit

Permalink
feat Output version number when plugin is activated
Browse files Browse the repository at this point in the history
  • Loading branch information
SweetInk committed Jul 6, 2024
1 parent 272eae7 commit 4f66e88
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import online.githuboy.jrebel.mybatisplus.cbp.*;
import org.zeroturnaround.javarebel.*;

import java.io.IOException;
import java.util.Properties;

/**
* Plugin Main entry
*
Expand All @@ -15,7 +18,15 @@ public class MybatisPlusPlugin implements Plugin {

@Override
public void preinit() {
log.infoEcho("Ready config JRebel MybatisPlus plugin...");
Properties p = new Properties();
String version = "";
try {
p.load(getClass().getClassLoader().getResourceAsStream("META-INF/maven/online.githuboy/jr-mybatisplus/pom.properties"));
version = p.getProperty("version");
} catch (IOException e) {
log.error("Can not read jr-mybatisplus/pom.properties:", e.getMessage());
}
log.infoEcho("Ready config JRebel MybatisPlus plugin(" + version + ")...");
ClassLoader classLoader = MybatisPlusPlugin.class.getClassLoader();
Integration integration = IntegrationFactory.getInstance();
//register class processor
Expand Down

0 comments on commit 4f66e88

Please sign in to comment.