Giter VIP home page Giter VIP logo

jshell-maven-plugin's Introduction

jshell-maven-plugin

Maven Plugin for the Java Shell Tool ( JShell )

Run it

$mvn compile com.github.johnpoth:jshell-maven-plugin:1.4: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.4: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.4: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.4: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

properties

Configure Java properties

runtimeClasspath

Add ./target/classes in classpath

false

testClasspath

Add ./target/test-classes in classpath

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.4: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.4</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!

jshell-maven-plugin's People

Contributors

johnpoth avatar jycr avatar allquixotic avatar thihup avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.