2012年11月14日水曜日

Gradleで外部依存関係に指定したjarファイルをプロジェクト内のディレクトリにコピーする

Gradleで外部依存関係に指定したjarファイルをプロジェクト内のディレクトリにコピーするbuild.gradleは、以下の通り。

apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven'
dependencies { compile 'commons-lang:commons-lang:2.6' }
repositories {
mavenCentral()
}
task copyLib(type: Copy){
from configurations.compile
into 'lib'
}
view raw build.gradle hosted with ❤ by GitHub

上記のcopyLibタスクを実行すると、commons-langのjarがプロジェクト内のlibディレクトリにコピーされる。

0 件のコメント:

コメントを投稿