Hello,
I'm developing a plugin and I would like to add an external jar dependency to my project.
The gradle documentation says to do it this way:
dependencies {
compile files("./libs/foo.jar")
}
When I added my jar, I got this error:
The closure 'org.elasticsearch.gradle.BuildPlugin$_configureConfigurations_closure5@2b92b146' is not valid as an action for argument
'org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_Decorated@433edba9'. It should accept no parameters, or one compatible with type
'org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency_Decorated'. It accepts (org.gradle.api.artifacts.ModuleDependency).
I tried to add it to my local repository.
$ mvn install:install-file -Dfile=duke-core-1.3-SNAPSHOT.jar -DgroupId=no.priv.garshol.duke -DartifactId=duke-core -Dversion=1.3 -Dpackaging=jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
Then added to my gradle:
compile "no.priv.garshol.duke:duke-core:1.3"
And I made sure to add mavenLocal()
to the repositories and the build prompts:
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compileClasspath'.
> Could not find no.priv.garshol.duke:duke-core:1.3.
Searched in the following locations:
https://repo1.maven.org/maven2/no/priv/garshol/duke/duke-core/1.3/duke-core-1.3.pom
https://repo1.maven.org/maven2/no/priv/garshol/duke/duke-core/1.3/duke-core-1.3.jar
It looks like it's ignoring my local repository but it's in my .m2 folder though.
I sort of did what was explained in this thread but it's specific to x-pack that I don't use.
If you have any ideas please feel free
Regards,