添加 Java REPL build.gradle

Adding Java REPL build.gradle

考虑一下我的 build.gradle:

plugins {
    id 'de.aaschmid.cpd' version '0.4'
}

group 'ar.fiuba.tdd'
version '1.0-SNAPSHOT'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'maven'
apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: "jacoco"
apply from: 'gradle/fatjar.gradle'
apply from: 'gradle/quality.gradle'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    jcenter()
    maven {
        url "http://nexus-tecnicas7510.rhcloud.com/nexus/content/repositories/third-party"
    }
}

dependencies {
    testCompile 'org.hamcrest:hamcrest-all:1.3'
    testCompile 'junit:junit:4.12'
    compile 'org.jgrapht:jgrapht-core:0.9.1'
    compile 'com.googlecode.json-simple:json-simple:1.1'
}

如何添加 JAVA REPL,例如 https://github.com/albertlatacz/java-repl or https://github.com/tkruse/gradle-groovysh-plugin

谢谢!

Gradle groovysh 插件包含说明,如何将其应用到您的 gradle 脚本中。您只需在插件中添加一个插件 ID 并修改构建脚本依赖项,例如:

plugins {
  id 'de.aaschmid.cpd' version '0.4'
  id "com.github.tkruse.groovysh" version "1.0.8"
}

并添加构建脚本存储库:

buildscript {
    repositories {
        jcenter()
    }
}

另请参阅:

Gradle Java-REPL Plugin

这是一个 Java 8(不是 Groovy)REPL,它建立在“java-repl (@Github)”之上,它有自己的网站:

http://www.javarepl.com

我相信 Java 9 有自己的内置 REPL。