Java Gradle依赖解决配置文件的问题

Java Gradle依赖解决配置文件的问题,java,maven,gradle,maven-2,maven-plugin,Java,Maven,Gradle,Maven 2,Maven Plugin,我在build.xml中构建了一个maven项目,其中包含使用另一个pom导入的所有测试依赖项。 当我试图将maven项目A纳入gradle项目B时 它给出了错误 我尝试使用[--info]首先它尝试正确的存储库url并更新jar[缓存的资源是最新的]。但最后它尝试了其他人,并抛出了错误 如何从gradle生成文件传递配置文件名 谢谢你的帮助 项目A->Maven Build-pom.xml <groupId>com.spring.test</groupId> <a

我在build.xml中构建了一个maven项目,其中包含使用另一个pom导入的所有测试依赖项。 当我试图将maven项目A纳入gradle项目B时 它给出了错误

我尝试使用[--info]首先它尝试正确的存储库url并更新jar[缓存的资源是最新的]。但最后它尝试了其他人,并抛出了错误

如何从gradle生成文件传递配置文件名

谢谢你的帮助

项目A->Maven Build-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>
错误消息

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

您可以使用GradleMaven设置插件。
使用maven设置插件,您可以传递activeProfiles、自定义maven设置文件。

属性project.qualifier似乎未定义。
编译组:'com.spring.test',名称:'Rest',版本:'1.0.0-SNAPSHOT',分类器:'AUAT'
表示
com.spring.test:Rest:1.0.0-SNAPSHOT:AUAT
,我没有看到它是如何连接到POM.xmlcom.spring中的
配置文件的。测试:Rest:1.0.0-SNAPSHOT:AUAT->它不是作为profile=AUAT工作的吗?我如何解决这个问题?为什么profile是未定义的?我从{project.qualifier}生成第一个jar分类器。
AUAT
是classifier而不是profile.qualifier,比如jar或war
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