TY for the answers. They made me come to a right solution.
Just a small review for other googlers. :)
Three slashes make no difference, as GEAR is windows share.
The error with 'sources must be absolute' is because of incorrect notation
ivyPatterns =
['file://gear/maven_repo/.m2/repository/[organisation]/[module]/ivy-[revision].xml']
artifactPatterns =
['file://gear/maven_repo/.m2/repository/[organisation]/[module]/[revision]/[artifact]-[revision].[type]']
Looks like we should always (?) use
addIvyPattern, addArtifactPattern
Configuring local repo is all about definitions of artifacts paths. The
approach to this is to run gradle with "-d" parameter for debug mode for
tracking pathes it searches for. It usually prints several "trying " and
then finds artifacts online.
So my hacky way to debug artifact resolutions is
Rename/delete cache dir
Edit build.gradle
run in debug mode, repeat from start if fails
There is also essential not so widely used "[classifier]" parameter in
ArtifactPatterns, which stands for "javadocs" and "sources". Here is my
brand new working local repo configuration based on dirty cache copying. The
first URLResolver is for local repo. =)
def local_repo = 'file://gear/maven_repo/.m2/repository'
repositories {
add(new org.apache.ivy.plugins.resolver.ChainResolver()) {
name = 'remote'
returnFirst = true
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'Repo'
addIvyPattern local_repo +
'/[organisation]/[module]/ivy-[revision].xml'
addArtifactPattern local_repo +
'/[organisation]/[module]/jars/[artifact]-[revision].[type]'
addArtifactPattern local_repo +
'/[organisation]/[module]/sources/[artifact]-[revision]-[classifier].[ext]'
addArtifactPattern local_repo +
'/[organisation]/[module]/javadocs/[artifact]-[revision]-[classifier].[ext]'
}
mavenRepo urls: "file://" + System.getProperty('user.home') +
"/.gradle/cache/"
mavenRepo urls: "http://repository.jboss.com/maven2"
mavenRepo(name: 'network', urls:
'file://gear/maven_repo/.m2/repository/')
mavenRepo urls:
"http://hibernate-generic-dao.googlecode.com/svn/trunk/maven-repo"
mavenRepo urls: 'http://gradle.artifactoryonline.com/gradle/plugins'
//idea plugin
mavenCentral()
}
}
--
View this message in context:
http://old.nabble.com/Supporting-local-corporate-repository-with-Gradle--tp29085662p29172726.html
Sent from the gradle-user mailing list archive at Nabble.com.