khouloud
(khouloud)
February 28, 2018, 8:32am
1
Hello, I am dealing with Gradle project and Artifactory. I’m trying to add some dependencies to my gradle project by adding :
repositories {
maven {
url 'http://localhost:8081/artifactory/libs-release-local/com/fasterxml/jackson/core/jackson-annotations/ '
credentials {
username = "${artifactory_user}"
password = “${artifactory_password}”
}}
}
dependencies {
compile group: ‘com/fasterxml/jackson/core’, name: ‘jackson-annotations’, version: ‘2.6.3’, ext: ‘pom’
}
However, there is no jar added to my project.
carlo_lf
(Carlo Luib-Finetti)
February 28, 2018, 9:05am
2
I think the used URL is invalid; it should only be
khouloud
(khouloud)
February 28, 2018, 9:23am
3
even if I use this URL: ‘http://localhost:8081/artifactory/libs-release-local’ , no jar is added to my project.
carlo_lf
(Carlo Luib-Finetti)
February 28, 2018, 9:28am
4
on command line, do you see any download failures?
this works for us:
we defined url and credentials in ‘gradle.properties’ and have this in ‘build.gradle’:
repositories {
maven {
url artifactoryUrl
credentials {
username artifactoryUser
password artifactoryPassword
}
}
}
khouloud
(khouloud)
February 28, 2018, 12:45pm
5
Thanks @carlo_lf for your help,
it’s true, there is no download failures, I checked ‘.gradle\caches\modules-2\files-2.1’ and I found all the downloaded jar, Since I’m a new be with gradle didn’t know about the gradle cache …
But I still don’t understand why the downloaded jar are not visible in my eclipse project under ‘Project and External Dependecies’
carlo_lf
(Carlo Luib-Finetti)
February 28, 2018, 12:48pm
6
Do have Buildship as Eclipse plugin? Then select the project and do ‘Gradle refresh project’. This will add the jar(s) to the Eclipse classpath.
khouloud
(khouloud)
February 28, 2018, 1:46pm
7
Actually, I’m working with Eclipse Oxygen, but I don’t have Eclipse Buildship plugin… I will try to add it and see the result.
carlo_lf
(Carlo Luib-Finetti)
February 28, 2018, 2:32pm
8
yes, you should if your projects are Gradle and Eclipse projects.