简体   繁体   English

为什么gradle依赖项的xml配置都带有“ Gradle__”前缀? Intellij IDEA 13

[英]Why do xml configs of gradle dependencies go with “Gradle__” prefix? Intellij IDEA 13

Java Spring project with Gradle 1.9 and vertx. 带有Gradle 1.9和vertx的Java Spring项目。 Local gradle distribution. 本地gradle分发。 Some lines of build.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'
            ...
}

I have an existing gradle project downloaded from git with xml configs in .idea/libraries folder named spring-aop_3_2_5_RELEASE.xml , for example, where we can find xml tag <library name="spring-aop-3.2.5.RELEASE">...</library> . 我在.idea / libraries文件夹中以xml配置从git下载了一个现有的gradle项目,名为spring-aop_3_2_5_RELEASE.xml ,例如,在这里我们可以找到xml标签<library name="spring-aop-3.2.5.RELEASE">...</library> After I had imported this project new file Gradle__spring-aop_3_2_5_RELEASE.xml appeared with only difference in name attribute of the library tag: Gradle: spring-aop-3.2.5.RELEASE . 在导入该项目之后,新文件Gradle__spring-aop_3_2_5_RELEASE.xml出现了,但library标签的name属性只有不同: Gradle: spring-aop-3.2.5.RELEASE So i have duplicate xml configs for dependencies. 所以我有重复的XML配置依赖。 I wonder why my gradle added that prefix. 我不知道为什么我的gradle加上了这个前缀。

The prefix is hardcoded, IDEA 13 needs a reimport of your old Gradle projects that were created in IDEA 12. It's not obvious, but there will be a notification about it in the next update. 前缀是硬编码的,IDEA 13需要重新导入在IDEA 12中创建的旧Gradle项目。这不是很明显,但是在下一个更新中将有关于它的通知。

In the Gradle generated project you can exclude the library files from the version control, same for the .iml files that can be also ignored when using Maven. 在Gradle生成的项目中,您可以从版本控制中排除库文件,与.iml文件相同,使用Maven时也可以忽略它们。 Other files can be still shared (like code style, run configurations, inspection profiles, etc). 其他文件仍可以共享(例如代码样式,运行配置,检查配置文件等)。 Check this document for details. 有关详细信息, 请查阅此文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM