だから、私はbuild-info-extractor-gradleプラグインを機能させようとすることで頭がいっぱいです...ベントしてすみません。;-)
私は gradle ラッパーを使用して、gradle 1.6、artifactory 3.0.0 を指定し、build-info-extractor-gradle プラグイン 2.1.x-SNAPSHOT への依存関係を指定しようとしています。これは、gradle 1.5以降で指定されたバージョンであるためです。 .
このチュートリアル ビデオに従おうとしましたが、まだ gradle 1.0 を参照しており、プラグインの 2.x バージョンを含まない jfrog リポジトリ パスを指定しているため、古いものである必要があります。
Artifactory セットアップ
- ローカル リポジトリ - 「gradle-release-local」 - レイアウトを gradle-default に設定
- リモートリポジトリ - 「gradle-plugins」 - jfrog インポートからわずかに変更 - 例: http://repo.jfrog.org/artifactory/gradle-plugins-snapshots
- 仮想リポジトリ - 「gradle」 - 「gradle-release-local」および「gradle-plugins」
Gradle セットアップ
settings.gradle (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
}
}
}
jar をローカルにアップロードすると、私のリポジトリ構成は機能します。たとえば、これが build-info-extractor-gradle jar をダウンロードする方法です。ただし、次のように、すべての依存関係が失敗します。
$ 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
私のgradle構成またはartifactory repo構成のどちらかが間違っているという考えはありますか? リモートリポジトリからの外部依存関係を解決できないのはなぜですか? mavenCentralを追加するだけですか?
アップデート
リポジトリに mavenCentral() を追加して、何が起こるかを確認しました。
$ 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
アップデート #2
新鮮に始めました。mavenCentral() とローカルにアップロードされた jar と pom を削除し、--info と --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.
したがって、明らかに、私の仮想「gradle」レポはアーティファクトを見つけていません。リモートの「gradle-plugins」リポジトリを検索しているかどうかはどうすればわかりますか?