ビルドにはmavenプロジェクトがあります。そのbuild.xmlの中には、すべてのテスト依存関係が含まれています。別のpomを使用してインポートします。 プロジェクトをグラブル化するためにmavenプロジェクトAを含めるときに エラーが発生します。Gradle dependency resolveプロファイルの問題
[--info]を試してみてください。まず、正しいリポジトリのURLと更新用のjar [キャッシュされたリソースは最新のものです]を試します。しかし、ついにそれは他の人を試してエラーを投げます。
プロファイル名フォームgradle build fileを渡すには?
が役に立ちます。
プロジェクトA - > Mavenのビルド - のpom.xml
<groupId>com.spring.test</groupId>
<artifactId>Rest</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Project</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<JUnitBOM.version.number>1.0.0</JUnitBOM.version.number>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencyManagement>
<dependencies>
<!-- Components -->
<dependency>
<groupId>com.test</groupId>
<artifactId>JUnitBOM</artifactId>
<version>${JUnitBOM.version.number}-${project.qualifier}
</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<profile>
<id>AUAT</id>
<properties>
<env>uat</env>
<project.qualifier>SNAPSHOT</project.qualifier>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
プロジェクトB - > Gradleのビルド - あなたが作ることができるbuild.gradle
apply plugin: 'java'
apply plugin: 'maven'
group = "com.spring.integration"
status = 'integration'
version = '1.0.0'
sourceCompatibility = 1.7
repositories {
maven { url "http://repo1" }
maven { url "http://maven.springframework.org/release" }
maven { url "http://maven.restlet.org" } }
dependencies {
compile group:'com.spring.test', name:'Rest', version:'1.0.0-SNAPSHOT', classifier: 'AUAT'
compile group:'org.restlet.jee', name:'org.restlet', version:'2.2'
compile group:'org.restlet.jee', name:'org.restlet.ext.servlet',version:'1.1'
compile group:'org.springframework', name:'spring-web', version:'3.2.1.RELEASE'
compile group:'org.slf4j', name:'slf4j-api', version:'1.7.2'
compile group:'ch.qos.logback', name:'logback-core', version:'1.0.9'
testCompile group:'junit', name:'junit', version:'4.11'
}
エラーメッセージ
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve com.spring.test:Rest:1.0.0-SNAPSHOT.
Required by:
com.spring.test:0.1.0-SNAPSHOT
> Could not resolve com.test:JUnitBOM:1.0.0-${project.qualifier}.
> java.lang.IllegalArgumentException (no error message)
> java.lang.IllegalArgumentException (no error message)
> java.lang.IllegalArgumentException (no error message)
> Could not HEAD 'http://maven.restlet.org/com/spring/test/Rest/1.0.0-SNAPSHOT/Rest-1.0.0-SNAPSHOT.pom'. Received status code 409 from server: Conflict
プロパティproject.qualifierは未定義のようです。 –
'コンパイルグループ: 'com.spring.test'、名前: 'Rest'、バージョン: '1.0.0-SNAPSHOT'、クラシファイア: 'AUAT' は' com.spring.test:Rest:1.0.0- SNAPSHOT:AUAT'、POM.xmlの 'profile'にどのように接続しているのか分かりませんでした。 – chenrui
com.spring.test:Rest:1.0.0-SNAPSHOT:AUAT - > profile = AUATとして機能しませんか?どうすればこの問題を解決できますか? – Ragu