gradle 1.10内部maven存储库永远索引在intellij 13中

时间:2014-03-11 23:48:59

标签: maven intellij-idea gradle maven-3 build.gradle

我有两个项目。一个Maven和一个Gradle。该公司还有一个内部maven存储库。我正在尝试设置Gradle以使用内部仓库。使用Intellij 13时,我将这样的repo添加到build.gradle中的Gradle

build.gradle文件

    apply plugin: 'java'
    apply plugin: 'war'

    sourceCompatibility = 1.5
    version = '1.0'

    maven {
            url "http://nexus.company.com/nexus/repo"
        }
        mavenLocal()
        mavenCentral()
        maven {
            url "https://oss.sonatype.org/content/repositories/snapshots"
        }

.m2 / settings.xml似乎被gradle完全忽略了(我试过不将maven repo添加到build.gradle文件中,并希望gradle会查看.m2 / settings.xml来找出哪里去从中获取工件

.m2 / settings.xml文件

    <settings>
     <mirrors>
       <mirror>
         <id>nexus</id>
         <mirrorOf>*</mirrorOf>
         <url>http://nexus.company.com/nexus/repo</url>
       </mirror>
     </mirrors>


     <profiles>
       <profile>
             <id>central-repo</id>
             <repositories>
                 <repository>
                     <id>central</id>
                     <url>http://central</url>
                     <releases><enabled>true</enabled></releases>
                     <snapshots><enabled>true</enabled></snapshots>
                 </repository>
                </repositories>
                <pluginRepositories>
                    <pluginRepository>
                        <id>central</id>
                        <url>http://central</url>
                        <releases><enabled>true</enabled></releases>
                        <snapshots><enabled>true</enabled></snapshots>
                    </pluginRepository>
                    </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>central-repo</activeProfile>
    </activeProfiles>
</settings>

Intellij在后台任务中永远旋转,在添加回购http://nexus.company.com/nexus/repo时说“处理索引”。没有它,一切工作都很好,除了内部工件无法下载。

但是,maven项目需要相同的工件下载并在几秒钟内准备就绪。

我很贪心。我犯了什么错误吗?

1 个答案:

答案 0 :(得分:0)

对于&#34;永远索引&#34;,我使用了一个全新的IntelliJ安装,结果只需要等待15-20米@ 100%CPU每个索引。在随后的发布中没有问题。