Reputation: 2492
So, here is what I want to do:
From what I understand it can be done using Gradle Artifactory Plugin.
Below is the sample build.gradle :
buildscript {
repositories {
jcenter()
}
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:3.1.0'
}
}
apply plugin: "com.jfrog.artifactory"
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'eclipse-wtp'
apply plugin: 'war'
group = 'a.b.c'
allprojects {
apply plugin: 'artifactory'
}
configurations{
...
}
dependencies {
compile group: 'a', name: 'b', version:'c'
compile group: 'x', name: 'y', version:'z'
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'gradle-release-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
ivy {
ivyLayout = '[organization]/[module]/ivy-[revision].xml'
artifactLayout = '[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]'
mavenCompatible = false
}
}
}
resolve {
repository {
repoKey = 'gradle'
repoKey = 'gradle-release-local'
maven = true
}
}
}
Sample Settings.gradle
rootProject.name = ‘partnering'
includeFlat ‘a'
project(‘:a').projectDir=new File(settings,'../a')
Note:
In dependencies, as you can see
ERROR:
Can somebody please let me with this issue.
Upvotes: 0
Views: 1275
Reputation: 22893
gradle
is a virtual repository, it aggregates number of other repositories in it.
In the repositories configuration, make sure that gradle
virtual repository contains the gradle-release-local
repository.
Once done, only leave one repoKey
for resolution, gradle
.
Upvotes: 1
Reputation: 1819
When you want to pull dependencies from a remote repository, you need to define them in build.gradle
. Pushing libraries to a repository is isolated from pulling libraries.
The following example contains two examples. One for maven central and and one for a custom repository.
repositories {
mavenCentral()
maven {
url "http://www.edwardraff.com/maven-repo/"
}
}
Look into the documentation.
Upvotes: 0