Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File dependencies in Gradle?

Tags:

gradle

I am trying to specify some jar dependencies using gradle and these instructions:

http://gradle.org/docs/current/userguide/dependency_management.html#sub:file_dependencies

I have the following project:

test
 -> libs
     -> svnant.jar
 -> build.gradle

where build.gradle contains:

dependencies {
  runtime files('libs/svnant.jar')
  runtime fileTree(dir: 'libs', include: '*.jar')
}

when I run gradle from windows cmd I get:

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\...\test\build.gradle' line: 16

* What went wrong:
A problem occurred evaluating root project 'test'.
> Could not find method runtime() for arguments [file collection] on root project 'test'.

what have I missed?

like image 789
u123 Avatar asked Jul 19 '12 12:07

u123


1 Answers

You only get a runtime configuration if you apply the java plugin (or declare the configuration on your own).

like image 76
Peter Niederwieser Avatar answered Nov 03 '22 01:11

Peter Niederwieser