So, I am at my wits end with trying to get the build-info-extractor-gradle plugin to work...sorry for venting. ;-)
I'm using the gradle wrapper, specifying gradle 1.6, artifactory 3.0.0, and trying to specify a dependency on the build-info-extractor-gradle plugin 2.1.x-SNAPSHOT, as this is the specified version for gradle 1.5 and above.
I was attempting to follow this tutorial video, but it must be out-dated because it is still referencing gradle 1.0 and specifying jfrog repo paths, which don't contain 2.x versions of the plugin.
Artifactory Setup
- local repo - "gradle-release-local" - layout set to gradle-default
- remote repo - "gradle-plugins" - slightly modified from the jfrog import - e.g. http://repo.jfrog.org/artifactory/gradle-plugins-snapshots
- virtual repo - "gradle" - "gradle-release-local" and "gradle-plugins"
Gradle Setup
settings.gradle (generated from artifactory)
buildscript {
repositories {
maven {
url 'http://artifactory.build.somewhere.com:8081/artifactory/gradle'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT'
}
}
allprojects {
apply plugin: 'artifactory'
}
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'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
My repository configuration does work, if I upload the jar, locally, e.g. this is how I got the build-info-extractor-gradle jar to be downloaded. However, all of the dependencies fail, as you can see:
$ gradlew tasks
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration 'classpath'.
> Could not find commons-io:commons-io:2.0.1.
Required by:
unspecified:unspecified:unspecified > org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT
> Could not find org.apache.ivy:ivy:2.2.0.
Required by:
unspecified:unspecified:unspecified > org.jfrog.buildinfo:build-info-extractor-
...
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Any ideas of what's wrong with either my gradle configuration or my artifactory repo configuration? Why can't it resolve external dependencies from remote repositories? Should I just add mavenCentral?
Update
I added mavenCentral() to the repositories, just to see what would happen and got:
$ gradlew tasks
Download http://repo1.maven.org/maven2/commons-io/commons-io/2.0.1/commons-io-2.0.1.pom
Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/15/commons-parent-15.pom
Download http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.pom
Download http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/5/commons-parent-5.pom
Download http://repo1.maven.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.pom
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration 'classpath'.
> Could not find org.jfrog.buildinfo:build-info-extractor:2.1.x-SNAPSHOT.
Required by:
unspecified:unspecified:unspecified > org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Update #2
Started fresh. Removed mavenCentral() and the locally uploaded jar and pom, then ran with --info and --refresh-dependencies:
$ gradlew --refresh-dependencies -i tasks
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file 'D:\repos\some_build\build.gradle'.
Included projects: [root project 'some_build']
Evaluating root project 'some_build' using build file 'D:\repos\some_build\build.gradle'.
Compiling build file 'D:\repos\some_build\build.gradle' using BuildScriptClasspathScriptTransformer.
Resource missing. [HTTP GET: http://artifactory.build.somewhere.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.1.0/build-info-extractor-gradle-2.1.0.pom]
Resource missing. [HTTP HEAD: http://artifactory.build.somewhere.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.1.0/build-info-extractor-gradle-2.1.0.jar]
FAILURE: Build failed with an exception.
So, clearly, my virtual "gradle" repo is not finding the artifact. How can I tell if it is searching the remote "gradle-plugins" repo?