• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

johnpoth/jshell-maven-plugin: Maven Plugin for the Java Shell Tool (JShell)

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

johnpoth/jshell-maven-plugin

开源软件地址(OpenSource Url):

https://github.com/johnpoth/jshell-maven-plugin

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

jshell-maven-plugin

Maven Plugin for the Java Shell Tool ( JShell )

Run it

$mvn compile com.github.johnpoth:jshell-maven-plugin:1.3:run
|  Welcome to JShell -- Version 10
|  For an introduction type: /help intro
jshell>

Now you can start using your project’s runtime classpath:

jshell> var foo = new org.apache.camel.component.beanclass.ClassComponent()
foo ==> org.apache.camel.component.beanclass.ClassComponent@4d1b0d2a
jshell>

To you use your project’s test classpath, add -DtestClasspath to the command and make sure you have compiled your test classes:

$mvn test-compile com.github.johnpoth:jshell-maven-plugin:1.3:run

If you notice some resources missing, you may have to invoke the install phase instead:

$mvn install com.github.johnpoth:jshell-maven-plugin:1.3:run -DskipTests

Once you project has been built properly, and you haven’t updated your source files, you can skip the building phase and invoke the plugin directly:

$mvn com.github.johnpoth:jshell-maven-plugin:1.3:run

Options

Name

Description

Default value

class-path

Explicitly set JShell’s class path

module-path

Set JShell’s module path

add-modules

Add modules from JShell’s module path

add-exports

Explicitly add exports

scripts

Add startup scripts to JShell ',' delimited

useProjectClasspath

Use project class path in JShell

True

options

Add other options to JShell. See docs

Reminder: plugin parameters when passed through the command line should be prefixed with 'jshell.' e.g: mvn com.github.johnpoth:jshell-maven-plugin:1.3:run -Djshell.scripts="script0,script1"

Adding to pom.xml

To use the plugin’s shortened prefix jshell, declare the plugin in your pom.xml

<pluginManagement>
  <plugins>
    <plugin>
      <groupId>com.github.johnpoth</groupId>
      <artifactId>jshell-maven-plugin</artifactId>
      <version>1.3</version>
    </plugin>
  </plugins>
</pluginManagement>

And now you’ll be able to run it by typing mvn jshell:run

$mvn jshell:run
|  Welcome to JShell -- Version 10
|  For an introduction type: /help intro
jshell>

Works on Java 9, 10 and 11+ Enjoy!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
algaworks/aula-comecando-com-maven发布时间:2022-08-17
下一篇:
gastaldi/jira-maven-plugin: Set of maven plugins for JIRA integration发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap