使用 Gradle 1.9 和 vertx 的 Java Spring 项目。本地 gradle 分布。 build.gradle的一些行
apply plugin 'java'
apply plugin 'groovy'
apply plugin 'idea'
buildscript {
repositories {
jcenter()
}
}
repositories {
mavenCentral()
}
dependencies {
...
compile 'org.springframework:spring-context-support:3.2.5.RELEASE'
compile 'org.springframework:spring-aop:3.2.5.RELEASE'
compile 'org.springframework:spring-aspects:3.2.5.RELEASE'
...
}
我从 git 下载了一个现有的 gradle 项目,其 xml 配置位于 .idea/libraries 文件夹中,名为 spring-aop_3_2_5_RELEASE.xml
,例如,我们可以在其中找到 xml 标签 <library name="spring-aop-3.2.5.RELEASE">...</library>
。
在我导入这个项目后,新文件 Gradle__spring-aop_3_2_5_RELEASE.xml
出现的唯一区别是 name
library
的属性标签:Gradle: spring-aop-3.2.5.RELEASE
。所以我有重复的依赖项 xml 配置。我想知道为什么我的 gradle 添加了这个前缀。
最佳答案
该前缀是硬编码的,IDEA 13 需要重新导入在 IDEA 12 中创建的旧 Gradle 项目。这一点并不明显,但在下次更新中将会有相关通知。
在 Gradle 生成的项目中,您可以从版本控制中排除库文件,对于使用 Maven 时也可以忽略的 .iml 文件也是如此。其他文件仍然可以共享(如代码样式、运行配置、检查配置文件等)。 Check this document了解详情。
关于java - 为什么 gradle 依赖项的 xml 配置带有 "Gradle__"前缀? Intellij IDEA 13,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20594998/