clojure-nrepl-starter

Clojure Nrepl Starter

License

License

Categories

Categories

Clojure Languages
GroupId

GroupId

com.github.matrixseven
ArtifactId

ArtifactId

clojure-nrepl-starter
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

clojure-nrepl-starter
Clojure Nrepl Starter
Project URL

Project URL

https://github.com/MatrixSeven/clojure-nrepl-starter
Source Code Management

Source Code Management

https://github.com/MatrixSeven/clojure-nrepl-starter

Download clojure-nrepl-starter

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.matrixseven/clojure-nrepl-starter/ -->
<dependency>
    <groupId>com.github.matrixseven</groupId>
    <artifactId>clojure-nrepl-starter</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.matrixseven/clojure-nrepl-starter/
implementation 'com.github.matrixseven:clojure-nrepl-starter:1.0.0'
// https://jarcasting.com/artifacts/com.github.matrixseven/clojure-nrepl-starter/
implementation ("com.github.matrixseven:clojure-nrepl-starter:1.0.0")
'com.github.matrixseven:clojure-nrepl-starter:jar:1.0.0'
<dependency org="com.github.matrixseven" name="clojure-nrepl-starter" rev="1.0.0">
  <artifact name="clojure-nrepl-starter" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.matrixseven', module='clojure-nrepl-starter', version='1.0.0')
)
libraryDependencies += "com.github.matrixseven" % "clojure-nrepl-starter" % "1.0.0"
[com.github.matrixseven/clojure-nrepl-starter "1.0.0"]

Dependencies

compile (7)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.1.3.RELEASE
org.slf4j : slf4j-api jar 1.7.26
org.clojure : clojure jar 1.10.0
org.clojure : tools.nrepl jar 0.2.12
cider » cider-nrepl jar 0.18.0
org.springframework.boot : spring-boot-configuration-processor Optional jar 2.1.3.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.1.3.RELEASE

Project Modules

There are no modules declared in this project.

clojure-nrepl-starter

Apache License, Version 2.0, January 2004 Jenkins Status

这是什么?

这个是一个Spring-boot的nrepl快速启动组件,在Maven中引入该依赖后可以快速在Spring-boot项目中启动一个Clojure-Cider-Nrepl.

可以做什么?

启动Nrepl后可以在终端使用lein connect直接连接到该服务,连接后可以直接获取Spring上下文中的Bean,并且直接调用Bean的方法/查看当前属性状态 结合Jrebel可以实现JavaCode热加载并且Repl不断开,但是在终端里并没有代码补全,如果想体验补全的快感建议使用Emacs+Cider环境.

为啥出来了个这么个玩意

突发奇想,然后就被无聊的搞出来了

如何使用

直接在项目的pom.xml里引入依赖

<dependency>
  <groupId>com.github.matrixseven</groupId>
  <artifactId>clojure-nrepl-starter</artifactId>
  <version>1.0.0</version>
</dependency>

然后配置

#是否启动,默认不启动
clojure.nrepl.state=true
#服务绑定的端口,默认7888
clojure.nrepl.port=7888
#仅在以下环境中启动,默认为dev,优先级高于state
clojure.nrepl.mode=dev,test

使用场景

某日你突然要临时发几条kafka/mq消息又或者热加载某个bean后需要调用某个方法测试,以前可能要写个Test用例或者web项目调用下接口等等.那么现在so easy,无论是本地还是跑在测试线的环境,只要您开启了nrepl服务,你就可以直接连接上去,干你想干的事情,直接发消息/调用某个方法而不要重启/发布你的项目.

eg:

体验

直接emacs中启动nrepl链接

或者直接在idea中添加远程repl

然后尝试使用它.

Enjoy it!

Versions

Version
1.0.0