2017-01-11 17 views

答えて

0

私はGroovyの答えを見つけ、それをJava用に移植しました。

あなたはgradleをダウンロードして、あなたのパスにgradleのbinディレクトリを追加してください。

に存在するようにプロジェクトのための新しいディレクトリを作成し、コマンドプロンプトを開き、次のコマンドを実行します。生成されたbuild.gradleファイルを編集して、依存関係以下を追加し

gradle init --type java-library 

を:

また
compile gradleApi() 

と、次の

apply plugin: 'idea' 

これは、私をもたらすべきです以下のように見えるのn build.gradle:バックコマンドプロンプトで次に

// Apply the java plugin to add support for Java 
apply plugin: 'java' 
apply plugin: 'idea' 

// In this section you declare where to find the dependencies of your project 
repositories { 
    // Use jcenter for resolving your dependencies. 
    // You can declare any Maven/Ivy/file repository here. 
    jcenter() 
} 

dependencies { 
    compile gradleApi() 

    // The production code uses Guava 
    compile 'com.google.guava:guava:20.0' 

    // Use JUnit test framework 
    testCompile 'junit:junit:4.12' 
} 

、実行します。

gradlew idea 

そしてIntelliJの

で生成されたプロジェクト

Groovyのソース開きますHow to setup a Gradle plugin project in IntelliJ?

関連する問題