私はいくつかの依存関係のためにローカルなアーティファクトに依存するプロジェクトを持っています。Gradle:マルチプロジェクト構造への移行 - リポジトリを解決できません。
のGradleこのプロジェクトにビルドし、リポジトリのための適切な設定と、正常に動作します:
buildscript {
repositories {
maven {
url "${artifactoryUrl}/libs-release"
}
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.10'
}
}
repositories {
maven {
url "${artifactoryUrl}/repo"
}
}
artifactory {
contextUrl = "${artifactoryUrl}"
publish {
repository {
repoKey = 'libs-snapshot-local' // The Artifactory repository key to publish to
username = "${artifactoryUser}" // The publisher user name
password = "${artifactoryPassword}" // The publisher password
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team' : 'core']
}
}
resolve {
repoKey = 'repo'
}
}
私はマルチプロジェクトの構造上のGradleのチュートリアルを行いました。 「リポジトリ」セクションをルートgradle.build
ファイルに移動できるようです。私はGradleのビルドを実行したときしかし、私はartifactoryからすべての依存関係に乗るとエラーだ:
は、外部依存関係に
注意を解決できません:私も含むルートディレクトリでgradle.properties
ファイルを追加しましたすべての変数(artifactoryUrlなど)
したがって、サブプロジェクトは、ルートgradle.build
ファイルに定義されているリポジトリを「参照」できないようです。助言がありますか?
allprojects {
}
subprojects {
buildscript {
repositories {
maven {
url "${artifactoryUrl}/libs-release"
}
}
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.10'
}
}
repositories {
maven {
url "${artifactoryUrl}/repo"
}
}
artifactory {
contextUrl = "${artifactoryUrl}"
publish {
repository {
repoKey = 'libs-snapshot-local' // The Artifactory repository key to publish to
username = "${artifactoryUser}" // The publisher user name
password = "${artifactoryPassword}" // The publisher password
}
defaults {
// Reference to Gradle publications defined in the build script.
// This is how we tell the Artifactory Plugin which artifacts should be
// published to Artifactory.
publications('mavenJava')
publishArtifacts = true
// Properties to be attached to the published artifacts.
properties = ['qa.level': 'basic', 'dev.team' : 'core']
}
}
resolve {
repoKey = 'repo'
}
}
}
'-i'または' -d'フラグを指定して実行するとどうなりますか?どこかに鉛があるはずです。 –
'id'で表示される関連メッセージだけです:設定ファイルのローカルリポジトリが定義されていません。デフォルトパス:/home/elad/.m2/repositoryを使用してください。 –
' apply plugin: 'がありません。更新された回答 –