This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
repositories { | |
flatDir(dirs: file("lib")) | |
} | |
dependencies { | |
compile ":commons-lang:2.6" | |
} |
この例では、プロジェクト内のlibフォルダ直下をリポジトリに指定している(5行目)。ファイルシステムをリポジトリとして使用する場合、依存関係の指定にはnameとversionを使用する(9行目)。groupの指定は必要ない。上記のように指定した場合はcommons-lang-2.6.jarが、versionを省略した場合はcommons-lang.jarが検索される。
関連リンク
- Gradle本家ユーザガイド
- Chapter 45. Dependency Managementの以下を参照
- 45.6.4. Flat directory repository
- 45.4.8. Optional attributes
- Chapter 45. Dependency Managementの以下を参照
- dev-xconnecting: Gradleで外部依存関係を指定する
- group, name, versionについてはこちらを参照