I am writing a Gradle Plugin where I need to set 1 or more Jar files as dependencies for the project that has my plugin activated.
I know is can do it in a build.gradle file like
But if I add the following in my plugin
Dependency dep = project.getDependencies().create("files(\"" + jarLocation + "\")"); project.getDependencies().add("compile", dep);
I get the following error message when build the project, so I am guessing there must be another way to add jar files as dependencies though plugins
* What went wrong: A problem occurred evaluating root project 'GradleJavaPackage'. > Failed to apply plugin 'archipelago'. > Supplied String module notation 'files("/mnt/c/Users/accou/workspace/private/Archipelago/Archipelago.Gradle/maui/build/libs/maui-1.0.jar")' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'.